{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 什么是Plotly\n",
    "\n",
    "Plotly是新一代的Python数据可视化开发库，它是在plotly.js的基础上建立的，提供了完善的交互能力和灵活的绘制选项。\n",
    "\n",
    "与早期的Matplotlib和Seaborn等库相比，Plotly将数据可视化提升到一个新的层次。Plotly内置完整的交互能力及编辑工具，支持在线和离线模式，提供稳定的API以便与现有应用集成，既可以在web浏览器中展示数据图表，也可以存入本地拷贝。\n",
    "\n",
    "目前plotly绘图主要是有两种方法：\n",
    "- plotly_express：plotly的高级封装\n",
    "- plotly.graph_objects：底层方法\n",
    "> 本项目的图形结果均运行在jupyter notebook中\n",
    "\n",
    "下面我们利用Plotly内置的数据集来看看如何绘图，主要基于plotly_express\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导入库\n",
    "\n",
    "在导入plotly的两种接口的时候，有两种约定方式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "\n",
    "# 两种绘图接口的约定导入方式\n",
    "import plotly_express as px  # 或 import plotly.express as px\n",
    "import plotly.graph_objects as go  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据集\n",
    "\n",
    "plotly有多种内置的数据集供我们使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>continent</th>\n",
       "      <th>year</th>\n",
       "      <th>lifeExp</th>\n",
       "      <th>pop</th>\n",
       "      <th>gdpPercap</th>\n",
       "      <th>iso_alpha</th>\n",
       "      <th>iso_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1952</td>\n",
       "      <td>28.801</td>\n",
       "      <td>8425333</td>\n",
       "      <td>779.445314</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1957</td>\n",
       "      <td>30.332</td>\n",
       "      <td>9240934</td>\n",
       "      <td>820.853030</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1962</td>\n",
       "      <td>31.997</td>\n",
       "      <td>10267083</td>\n",
       "      <td>853.100710</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1967</td>\n",
       "      <td>34.020</td>\n",
       "      <td>11537966</td>\n",
       "      <td>836.197138</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1972</td>\n",
       "      <td>36.088</td>\n",
       "      <td>13079460</td>\n",
       "      <td>739.981106</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       country continent  year  lifeExp       pop   gdpPercap iso_alpha  \\\n",
       "0  Afghanistan      Asia  1952   28.801   8425333  779.445314       AFG   \n",
       "1  Afghanistan      Asia  1957   30.332   9240934  820.853030       AFG   \n",
       "2  Afghanistan      Asia  1962   31.997  10267083  853.100710       AFG   \n",
       "3  Afghanistan      Asia  1967   34.020  11537966  836.197138       AFG   \n",
       "4  Afghanistan      Asia  1972   36.088  13079460  739.981106       AFG   \n",
       "\n",
       "   iso_num  \n",
       "0        4  \n",
       "1        4  \n",
       "2        4  \n",
       "3        4  \n",
       "4        4  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gapminder = px.data.gapminder() \n",
    "gapminder.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Afghanistan          12\n",
       "Pakistan             12\n",
       "New Zealand          12\n",
       "Nicaragua            12\n",
       "Niger                12\n",
       "                     ..\n",
       "Eritrea              12\n",
       "Equatorial Guinea    12\n",
       "El Salvador          12\n",
       "Egypt                12\n",
       "Zimbabwe             12\n",
       "Name: country, Length: 142, dtype: int64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gapminder[\"country\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>total_bill</th>\n",
       "      <th>tip</th>\n",
       "      <th>sex</th>\n",
       "      <th>smoker</th>\n",
       "      <th>day</th>\n",
       "      <th>time</th>\n",
       "      <th>size</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>16.99</td>\n",
       "      <td>1.01</td>\n",
       "      <td>Female</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10.34</td>\n",
       "      <td>1.66</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>21.01</td>\n",
       "      <td>3.50</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>23.68</td>\n",
       "      <td>3.31</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>24.59</td>\n",
       "      <td>3.61</td>\n",
       "      <td>Female</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   total_bill   tip     sex smoker  day    time  size\n",
       "0       16.99  1.01  Female     No  Sun  Dinner     2\n",
       "1       10.34  1.66    Male     No  Sun  Dinner     3\n",
       "2       21.01  3.50    Male     No  Sun  Dinner     3\n",
       "3       23.68  3.31    Male     No  Sun  Dinner     2\n",
       "4       24.59  3.61  Female     No  Sun  Dinner     4"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tips = px.data.tips()  \n",
    "tips.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "      <th>species_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sepal_length  sepal_width  petal_length  petal_width species  species_id\n",
       "0           5.1          3.5           1.4          0.2  setosa           1\n",
       "1           4.9          3.0           1.4          0.2  setosa           1\n",
       "2           4.7          3.2           1.3          0.2  setosa           1\n",
       "3           4.6          3.1           1.5          0.2  setosa           1\n",
       "4           5.0          3.6           1.4          0.2  setosa           1"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris = px.data.iris()  # 著名的鸢尾花数据集\n",
    "iris.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species',\n",
       "       'species_id'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>date</th>\n",
       "      <th>GOOG</th>\n",
       "      <th>AAPL</th>\n",
       "      <th>AMZN</th>\n",
       "      <th>FB</th>\n",
       "      <th>NFLX</th>\n",
       "      <th>MSFT</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2018-01-01</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2018-01-08</td>\n",
       "      <td>1.018172</td>\n",
       "      <td>1.011943</td>\n",
       "      <td>1.061881</td>\n",
       "      <td>0.959968</td>\n",
       "      <td>1.053526</td>\n",
       "      <td>1.015988</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2018-01-15</td>\n",
       "      <td>1.032008</td>\n",
       "      <td>1.019771</td>\n",
       "      <td>1.053240</td>\n",
       "      <td>0.970243</td>\n",
       "      <td>1.049860</td>\n",
       "      <td>1.020524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2018-01-22</td>\n",
       "      <td>1.066783</td>\n",
       "      <td>0.980057</td>\n",
       "      <td>1.140676</td>\n",
       "      <td>1.016858</td>\n",
       "      <td>1.307681</td>\n",
       "      <td>1.066561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2018-01-29</td>\n",
       "      <td>1.008773</td>\n",
       "      <td>0.917143</td>\n",
       "      <td>1.163374</td>\n",
       "      <td>1.018357</td>\n",
       "      <td>1.273537</td>\n",
       "      <td>1.040708</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         date      GOOG      AAPL      AMZN        FB      NFLX      MSFT\n",
       "0  2018-01-01  1.000000  1.000000  1.000000  1.000000  1.000000  1.000000\n",
       "1  2018-01-08  1.018172  1.011943  1.061881  0.959968  1.053526  1.015988\n",
       "2  2018-01-15  1.032008  1.019771  1.053240  0.970243  1.049860  1.020524\n",
       "3  2018-01-22  1.066783  0.980057  1.140676  1.016858  1.307681  1.066561\n",
       "4  2018-01-29  1.008773  0.917143  1.163374  1.018357  1.273537  1.040708"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock = px.data.stocks()  # 一份股票数据集\n",
    "stock.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Index(['date', 'GOOG', 'AAPL', 'AMZN', 'FB', 'NFLX', 'MSFT'], dtype='object')\n"
     ]
    }
   ],
   "source": [
    "print(stock.columns)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 绘图\n",
    "\n",
    "下面几种常见的图形，快速了解Plotly的绘图"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 柱状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>continent</th>\n",
       "      <th>year</th>\n",
       "      <th>lifeExp</th>\n",
       "      <th>pop</th>\n",
       "      <th>gdpPercap</th>\n",
       "      <th>iso_alpha</th>\n",
       "      <th>iso_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1476</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1952</td>\n",
       "      <td>69.620</td>\n",
       "      <td>4815000</td>\n",
       "      <td>14734.23275</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1477</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1957</td>\n",
       "      <td>70.560</td>\n",
       "      <td>5126000</td>\n",
       "      <td>17909.48973</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1478</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1962</td>\n",
       "      <td>71.320</td>\n",
       "      <td>5666000</td>\n",
       "      <td>20431.09270</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1479</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1967</td>\n",
       "      <td>72.770</td>\n",
       "      <td>6063000</td>\n",
       "      <td>22966.14432</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1480</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1972</td>\n",
       "      <td>73.780</td>\n",
       "      <td>6401400</td>\n",
       "      <td>27195.11304</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1481</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1977</td>\n",
       "      <td>75.390</td>\n",
       "      <td>6316424</td>\n",
       "      <td>26982.29052</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1482</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1982</td>\n",
       "      <td>76.210</td>\n",
       "      <td>6468126</td>\n",
       "      <td>28397.71512</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1483</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1987</td>\n",
       "      <td>77.410</td>\n",
       "      <td>6649942</td>\n",
       "      <td>30281.70459</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1484</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1992</td>\n",
       "      <td>78.030</td>\n",
       "      <td>6995447</td>\n",
       "      <td>31871.53030</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1485</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>1997</td>\n",
       "      <td>79.370</td>\n",
       "      <td>7193761</td>\n",
       "      <td>32135.32301</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1486</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>2002</td>\n",
       "      <td>80.620</td>\n",
       "      <td>7361757</td>\n",
       "      <td>34480.95771</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1487</th>\n",
       "      <td>Switzerland</td>\n",
       "      <td>Europe</td>\n",
       "      <td>2007</td>\n",
       "      <td>81.701</td>\n",
       "      <td>7554661</td>\n",
       "      <td>37506.41907</td>\n",
       "      <td>CHE</td>\n",
       "      <td>756</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          country continent  year  lifeExp      pop    gdpPercap iso_alpha  \\\n",
       "1476  Switzerland    Europe  1952   69.620  4815000  14734.23275       CHE   \n",
       "1477  Switzerland    Europe  1957   70.560  5126000  17909.48973       CHE   \n",
       "1478  Switzerland    Europe  1962   71.320  5666000  20431.09270       CHE   \n",
       "1479  Switzerland    Europe  1967   72.770  6063000  22966.14432       CHE   \n",
       "1480  Switzerland    Europe  1972   73.780  6401400  27195.11304       CHE   \n",
       "1481  Switzerland    Europe  1977   75.390  6316424  26982.29052       CHE   \n",
       "1482  Switzerland    Europe  1982   76.210  6468126  28397.71512       CHE   \n",
       "1483  Switzerland    Europe  1987   77.410  6649942  30281.70459       CHE   \n",
       "1484  Switzerland    Europe  1992   78.030  6995447  31871.53030       CHE   \n",
       "1485  Switzerland    Europe  1997   79.370  7193761  32135.32301       CHE   \n",
       "1486  Switzerland    Europe  2002   80.620  7361757  34480.95771       CHE   \n",
       "1487  Switzerland    Europe  2007   81.701  7554661  37506.41907       CHE   \n",
       "\n",
       "      iso_num  \n",
       "1476      756  \n",
       "1477      756  \n",
       "1478      756  \n",
       "1479      756  \n",
       "1480      756  \n",
       "1481      756  \n",
       "1482      756  \n",
       "1483      756  \n",
       "1484      756  \n",
       "1485      756  \n",
       "1486      756  \n",
       "1487      756  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 指定选取国家：Switzerland\n",
    "\n",
    "Switzerland  = gapminder[gapminder[\"country\"] == \"Switzerland\"]\n",
    "Switzerland "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "alignmentgroup": "True",
         "hovertemplate": "year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "",
         "marker": {
          "color": "#636efa",
          "pattern": {
           "shape": ""
          }
         },
         "name": "",
         "offsetgroup": "",
         "orientation": "v",
         "showlegend": false,
         "textposition": "auto",
         "type": "bar",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4815000,
          5126000,
          5666000,
          6063000,
          6401400,
          6316424,
          6468126,
          6649942,
          6995447,
          7193761,
          7361757,
          7554661
         ],
         "yaxis": "y"
        }
       ],
       "layout": {
        "barmode": "relative",
        "legend": {
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "year"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "pop"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = px.bar(Switzerland,x=\"year\",y=\"pop\")\n",
    "\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "type": "bar",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "y": [
          4815000,
          5126000,
          5666000,
          6063000,
          6401400,
          6316424,
          6468126,
          6649942,
          6995447,
          7193761,
          7361757,
          7554661
         ]
        }
       ],
       "layout": {
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = go.Figure(\n",
    "    data = (\n",
    "        go.Bar(x=Switzerland[\"year\"].tolist(),  # x轴数据\n",
    "               y=Switzerland[\"pop\"].tolist(),  # y轴数据\n",
    "              )\n",
    "    )\n",
    ")\n",
    "\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 股票趋势图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "date=%{x}<br>FB=%{y}<extra></extra>",
         "legendgroup": "",
         "line": {
          "color": "#636efa",
          "dash": "solid"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "",
         "orientation": "v",
         "showlegend": false,
         "type": "scatter",
         "x": [
          "2018-01-01",
          "2018-01-08",
          "2018-01-15",
          "2018-01-22",
          "2018-01-29",
          "2018-02-05",
          "2018-02-12",
          "2018-02-19",
          "2018-02-26",
          "2018-03-05",
          "2018-03-12",
          "2018-03-19",
          "2018-03-26",
          "2018-04-02",
          "2018-04-09",
          "2018-04-16",
          "2018-04-23",
          "2018-04-30",
          "2018-05-07",
          "2018-05-14",
          "2018-05-21",
          "2018-05-28",
          "2018-06-04",
          "2018-06-11",
          "2018-06-18",
          "2018-06-25",
          "2018-07-02",
          "2018-07-09",
          "2018-07-16",
          "2018-07-23",
          "2018-07-30",
          "2018-08-06",
          "2018-08-13",
          "2018-08-20",
          "2018-08-27",
          "2018-09-03",
          "2018-09-10",
          "2018-09-17",
          "2018-09-24",
          "2018-10-01",
          "2018-10-08",
          "2018-10-15",
          "2018-10-22",
          "2018-10-29",
          "2018-11-05",
          "2018-11-12",
          "2018-11-19",
          "2018-11-26",
          "2018-12-03",
          "2018-12-10",
          "2018-12-17",
          "2018-12-24",
          "2018-12-31",
          "2019-01-07",
          "2019-01-14",
          "2019-01-21",
          "2019-01-28",
          "2019-02-04",
          "2019-02-11",
          "2019-02-18",
          "2019-02-25",
          "2019-03-04",
          "2019-03-11",
          "2019-03-18",
          "2019-03-25",
          "2019-04-01",
          "2019-04-08",
          "2019-04-15",
          "2019-04-22",
          "2019-04-29",
          "2019-05-06",
          "2019-05-13",
          "2019-05-20",
          "2019-05-27",
          "2019-06-03",
          "2019-06-10",
          "2019-06-17",
          "2019-06-24",
          "2019-07-01",
          "2019-07-08",
          "2019-07-15",
          "2019-07-22",
          "2019-07-29",
          "2019-08-05",
          "2019-08-12",
          "2019-08-19",
          "2019-08-26",
          "2019-09-02",
          "2019-09-09",
          "2019-09-16",
          "2019-09-23",
          "2019-09-30",
          "2019-10-07",
          "2019-10-14",
          "2019-10-21",
          "2019-10-28",
          "2019-11-04",
          "2019-11-11",
          "2019-11-18",
          "2019-11-25",
          "2019-12-02",
          "2019-12-09",
          "2019-12-16",
          "2019-12-23",
          "2019-12-30"
         ],
         "xaxis": "x",
         "y": [
          1,
          0.9599678310954936,
          0.9702434422185674,
          1.0168584099483515,
          1.0183569327795472,
          0.9425207136466456,
          0.949210571606832,
          0.9809472149548658,
          0.9452501435830832,
          0.9913298905647344,
          0.9905806264731936,
          0.8530371628674177,
          0.8551778853033591,
          0.8413165210173983,
          0.8804923666954552,
          0.8899116599439659,
          0.9290339332394776,
          0.9451966568307202,
          1.0007492587396545,
          0.9776825642702948,
          0.9896708164943808,
          1.038212463316699,
          1.0120417443283358,
          1.048166977313343,
          1.0796895826698554,
          1.039978596521961,
          1.0876638451914205,
          1.109553119307901,
          1.12357503483302,
          0.9359914015737306,
          0.951458353177682,
          0.9647310099631464,
          0.9301578668399936,
          0.934706922085943,
          0.940486970067317,
          0.8725715159998442,
          0.868718232741186,
          0.8719828084993478,
          0.8801712695690254,
          0.8420122930046896,
          0.822799036998693,
          0.8244581110690464,
          0.7780036945784202,
          0.8046561475625534,
          0.7758094853901156,
          0.7467486995959743,
          0.7050039698687512,
          0.7525287475773482,
          0.735456214007293,
          0.7709927394918039,
          0.668718185644586,
          0.712871248181817,
          0.7382927084305257,
          0.769601275795517,
          0.8029969932139043,
          0.7974845609584834,
          0.8868611275292119,
          0.8955311566861818,
          0.8696815348242483,
          0.8664168787877908,
          0.8685041144713691,
          0.907679960149426,
          0.8883060779778621,
          0.8795289843340972,
          0.8921059494105662,
          0.9404334779630672,
          0.9585228806468435,
          0.9541342963617566,
          1.024832747396326,
          1.0461332337340143,
          1.0079742571696786,
          0.9917045600737096,
          0.9690125351133252,
          0.9497992791073284,
          0.9277495340299856,
          0.9704575658402708,
          1.0229595550561554,
          1.0329140690527994,
          1.0511104505931883,
          1.0964409334832987,
          1.0616001853379655,
          1.0690393020378066,
          1.011613582715111,
          1.0053518863681492,
          0.9831415097733526,
          0.951297801938524,
          0.993684731270493,
          1.003425201923729,
          1.0018196199576253,
          1.0164837404393767,
          0.9478191079105452,
          0.9657478790768677,
          0.9857639608531776,
          0.9946481136318508,
          1.0055659243596704,
          1.03623221184162,
          1.0213539730900516,
          1.044153062537231,
          1.0640620851786324,
          1.0791543619217223,
          1.07599677037206,
          1.0388546682733315,
          1.104094173804843,
          1.113727585323171,
          1.0984746770626277
         ],
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "date"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "FB"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# FB公司股票趋势图\n",
    "fig = px.line(stock, x='date', y=\"FB\")  \n",
    "\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\Python38\\lib\\site-packages\\plotly\\graph_objs\\_deprecations.py:378: DeprecationWarning:\n",
      "\n",
      "plotly.graph_objs.Line is deprecated.\n",
      "Please replace it with one of the following more specific types\n",
      "  - plotly.graph_objs.scatter.Line\n",
      "  - plotly.graph_objs.layout.shape.Line\n",
      "  - etc.\n",
      "\n",
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "type": "scatter",
         "x": [
          "2018-01-01",
          "2018-01-08",
          "2018-01-15",
          "2018-01-22",
          "2018-01-29",
          "2018-02-05",
          "2018-02-12",
          "2018-02-19",
          "2018-02-26",
          "2018-03-05",
          "2018-03-12",
          "2018-03-19",
          "2018-03-26",
          "2018-04-02",
          "2018-04-09",
          "2018-04-16",
          "2018-04-23",
          "2018-04-30",
          "2018-05-07",
          "2018-05-14",
          "2018-05-21",
          "2018-05-28",
          "2018-06-04",
          "2018-06-11",
          "2018-06-18",
          "2018-06-25",
          "2018-07-02",
          "2018-07-09",
          "2018-07-16",
          "2018-07-23",
          "2018-07-30",
          "2018-08-06",
          "2018-08-13",
          "2018-08-20",
          "2018-08-27",
          "2018-09-03",
          "2018-09-10",
          "2018-09-17",
          "2018-09-24",
          "2018-10-01",
          "2018-10-08",
          "2018-10-15",
          "2018-10-22",
          "2018-10-29",
          "2018-11-05",
          "2018-11-12",
          "2018-11-19",
          "2018-11-26",
          "2018-12-03",
          "2018-12-10",
          "2018-12-17",
          "2018-12-24",
          "2018-12-31",
          "2019-01-07",
          "2019-01-14",
          "2019-01-21",
          "2019-01-28",
          "2019-02-04",
          "2019-02-11",
          "2019-02-18",
          "2019-02-25",
          "2019-03-04",
          "2019-03-11",
          "2019-03-18",
          "2019-03-25",
          "2019-04-01",
          "2019-04-08",
          "2019-04-15",
          "2019-04-22",
          "2019-04-29",
          "2019-05-06",
          "2019-05-13",
          "2019-05-20",
          "2019-05-27",
          "2019-06-03",
          "2019-06-10",
          "2019-06-17",
          "2019-06-24",
          "2019-07-01",
          "2019-07-08",
          "2019-07-15",
          "2019-07-22",
          "2019-07-29",
          "2019-08-05",
          "2019-08-12",
          "2019-08-19",
          "2019-08-26",
          "2019-09-02",
          "2019-09-09",
          "2019-09-16",
          "2019-09-23",
          "2019-09-30",
          "2019-10-07",
          "2019-10-14",
          "2019-10-21",
          "2019-10-28",
          "2019-11-04",
          "2019-11-11",
          "2019-11-18",
          "2019-11-25",
          "2019-12-02",
          "2019-12-09",
          "2019-12-16",
          "2019-12-23",
          "2019-12-30"
         ],
         "y": [
          1,
          0.9599678310954936,
          0.9702434422185674,
          1.0168584099483515,
          1.0183569327795472,
          0.9425207136466456,
          0.949210571606832,
          0.9809472149548658,
          0.9452501435830832,
          0.9913298905647344,
          0.9905806264731936,
          0.8530371628674177,
          0.8551778853033591,
          0.8413165210173983,
          0.8804923666954552,
          0.8899116599439659,
          0.9290339332394776,
          0.9451966568307202,
          1.0007492587396545,
          0.9776825642702948,
          0.9896708164943808,
          1.038212463316699,
          1.0120417443283358,
          1.048166977313343,
          1.0796895826698554,
          1.039978596521961,
          1.0876638451914205,
          1.109553119307901,
          1.12357503483302,
          0.9359914015737306,
          0.951458353177682,
          0.9647310099631464,
          0.9301578668399936,
          0.934706922085943,
          0.940486970067317,
          0.8725715159998442,
          0.868718232741186,
          0.8719828084993478,
          0.8801712695690254,
          0.8420122930046896,
          0.822799036998693,
          0.8244581110690464,
          0.7780036945784202,
          0.8046561475625534,
          0.7758094853901156,
          0.7467486995959743,
          0.7050039698687512,
          0.7525287475773482,
          0.735456214007293,
          0.7709927394918039,
          0.668718185644586,
          0.712871248181817,
          0.7382927084305257,
          0.769601275795517,
          0.8029969932139043,
          0.7974845609584834,
          0.8868611275292119,
          0.8955311566861818,
          0.8696815348242483,
          0.8664168787877908,
          0.8685041144713691,
          0.907679960149426,
          0.8883060779778621,
          0.8795289843340972,
          0.8921059494105662,
          0.9404334779630672,
          0.9585228806468435,
          0.9541342963617566,
          1.024832747396326,
          1.0461332337340143,
          1.0079742571696786,
          0.9917045600737096,
          0.9690125351133252,
          0.9497992791073284,
          0.9277495340299856,
          0.9704575658402708,
          1.0229595550561554,
          1.0329140690527994,
          1.0511104505931883,
          1.0964409334832987,
          1.0616001853379655,
          1.0690393020378066,
          1.011613582715111,
          1.0053518863681492,
          0.9831415097733526,
          0.951297801938524,
          0.993684731270493,
          1.003425201923729,
          1.0018196199576253,
          1.0164837404393767,
          0.9478191079105452,
          0.9657478790768677,
          0.9857639608531776,
          0.9946481136318508,
          1.0055659243596704,
          1.03623221184162,
          1.0213539730900516,
          1.044153062537231,
          1.0640620851786324,
          1.0791543619217223,
          1.07599677037206,
          1.0388546682733315,
          1.104094173804843,
          1.113727585323171,
          1.0984746770626277
         ]
        }
       ],
       "layout": {
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = go.Figure(data=[go.Line(\n",
    "    x=stock['date'].tolist(), \n",
    "    y=stock[\"FB\"].tolist()\n",
    ")])\n",
    "\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>continent</th>\n",
       "      <th>year</th>\n",
       "      <th>lifeExp</th>\n",
       "      <th>pop</th>\n",
       "      <th>gdpPercap</th>\n",
       "      <th>iso_alpha</th>\n",
       "      <th>iso_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>2002</td>\n",
       "      <td>42.129</td>\n",
       "      <td>25268405</td>\n",
       "      <td>726.734055</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>Albania</td>\n",
       "      <td>Europe</td>\n",
       "      <td>2002</td>\n",
       "      <td>75.651</td>\n",
       "      <td>3508512</td>\n",
       "      <td>4604.211737</td>\n",
       "      <td>ALB</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>Algeria</td>\n",
       "      <td>Africa</td>\n",
       "      <td>2002</td>\n",
       "      <td>70.994</td>\n",
       "      <td>31287142</td>\n",
       "      <td>5288.040382</td>\n",
       "      <td>DZA</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>Angola</td>\n",
       "      <td>Africa</td>\n",
       "      <td>2002</td>\n",
       "      <td>41.003</td>\n",
       "      <td>10866106</td>\n",
       "      <td>2773.287312</td>\n",
       "      <td>AGO</td>\n",
       "      <td>24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>Argentina</td>\n",
       "      <td>Americas</td>\n",
       "      <td>2002</td>\n",
       "      <td>74.340</td>\n",
       "      <td>38331121</td>\n",
       "      <td>8797.640716</td>\n",
       "      <td>ARG</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1654</th>\n",
       "      <td>Vietnam</td>\n",
       "      <td>Asia</td>\n",
       "      <td>2002</td>\n",
       "      <td>73.017</td>\n",
       "      <td>80908147</td>\n",
       "      <td>1764.456677</td>\n",
       "      <td>VNM</td>\n",
       "      <td>704</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1666</th>\n",
       "      <td>West Bank and Gaza</td>\n",
       "      <td>Asia</td>\n",
       "      <td>2002</td>\n",
       "      <td>72.370</td>\n",
       "      <td>3389578</td>\n",
       "      <td>4515.487575</td>\n",
       "      <td>PSE</td>\n",
       "      <td>275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1678</th>\n",
       "      <td>Yemen, Rep.</td>\n",
       "      <td>Asia</td>\n",
       "      <td>2002</td>\n",
       "      <td>60.308</td>\n",
       "      <td>18701257</td>\n",
       "      <td>2234.820827</td>\n",
       "      <td>YEM</td>\n",
       "      <td>887</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1690</th>\n",
       "      <td>Zambia</td>\n",
       "      <td>Africa</td>\n",
       "      <td>2002</td>\n",
       "      <td>39.193</td>\n",
       "      <td>10595811</td>\n",
       "      <td>1071.613938</td>\n",
       "      <td>ZMB</td>\n",
       "      <td>894</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1702</th>\n",
       "      <td>Zimbabwe</td>\n",
       "      <td>Africa</td>\n",
       "      <td>2002</td>\n",
       "      <td>39.989</td>\n",
       "      <td>11926563</td>\n",
       "      <td>672.038623</td>\n",
       "      <td>ZWE</td>\n",
       "      <td>716</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>142 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                 country continent  year  lifeExp       pop    gdpPercap  \\\n",
       "10           Afghanistan      Asia  2002   42.129  25268405   726.734055   \n",
       "22               Albania    Europe  2002   75.651   3508512  4604.211737   \n",
       "34               Algeria    Africa  2002   70.994  31287142  5288.040382   \n",
       "46                Angola    Africa  2002   41.003  10866106  2773.287312   \n",
       "58             Argentina  Americas  2002   74.340  38331121  8797.640716   \n",
       "...                  ...       ...   ...      ...       ...          ...   \n",
       "1654             Vietnam      Asia  2002   73.017  80908147  1764.456677   \n",
       "1666  West Bank and Gaza      Asia  2002   72.370   3389578  4515.487575   \n",
       "1678         Yemen, Rep.      Asia  2002   60.308  18701257  2234.820827   \n",
       "1690              Zambia    Africa  2002   39.193  10595811  1071.613938   \n",
       "1702            Zimbabwe    Africa  2002   39.989  11926563   672.038623   \n",
       "\n",
       "     iso_alpha  iso_num  \n",
       "10         AFG        4  \n",
       "22         ALB        8  \n",
       "34         DZA       12  \n",
       "46         AGO       24  \n",
       "58         ARG       32  \n",
       "...        ...      ...  \n",
       "1654       VNM      704  \n",
       "1666       PSE      275  \n",
       "1678       YEM      887  \n",
       "1690       ZMB      894  \n",
       "1702       ZWE      716  \n",
       "\n",
       "[142 rows x 8 columns]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# gapminder_2002 = gapminder.query(\"year==2002\")\n",
    "\n",
    "gapminder_2002 = gapminder[gapminder[\"year\"] == 2002]\n",
    "gapminder_2002"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "continent=Asia<br>gdpPercap=%{x}<br>lifeExp=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "marker": {
          "color": "#636efa",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Asia",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          726.7340548,
          23403.55927,
          1136.3904300000004,
          896.2260152999999,
          3119.280896,
          30209.015160000006,
          1746.769454,
          2873.91287,
          9240.761975,
          4390.717312,
          21905.59514,
          28604.5919,
          3844.917194,
          1646.758151,
          19233.98818,
          35110.10566,
          9313.93883,
          10206.97794,
          2140.739323,
          611,
          1057.206311,
          19774.83687,
          2092.712441,
          2650.921068,
          19014.54118,
          36023.1054,
          3015.378833,
          4090.925331,
          23235.42329,
          5913.187529,
          1764.456677,
          4515.487575,
          2234.820827
         ],
         "xaxis": "x",
         "y": [
          42.129,
          74.795,
          62.01300000000001,
          56.752,
          72.028,
          81.495,
          62.879,
          68.58800000000001,
          69.45100000000001,
          57.04600000000001,
          79.696,
          82,
          71.263,
          66.66199999999999,
          77.045,
          76.904,
          71.028,
          73.044,
          65.033,
          59.908,
          61.34,
          74.193,
          63.61,
          70.303,
          71.626,
          78.77,
          70.815,
          73.053,
          76.99,
          68.564,
          73.017,
          72.37,
          60.308
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "continent=Europe<br>gdpPercap=%{x}<br>lifeExp=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "marker": {
          "color": "#EF553B",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Europe",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          4604.211737,
          32417.60769,
          30485.88375,
          6018.975239,
          7696.777725,
          11628.38895,
          17596.210219999994,
          32166.50006,
          28204.59057,
          28926.03234,
          30035.80198,
          22514.2548,
          14843.93556,
          31163.20196,
          34077.04939,
          27968.09817,
          6557.194282,
          33724.75778,
          44683.97525,
          12002.23908,
          19970.90787,
          7885.360081,
          7236.075251,
          13638.778369999998,
          20660.01936,
          24835.47166,
          29341.630930000007,
          34480.95771,
          6508.085718,
          29478.99919
         ],
         "xaxis": "x",
         "y": [
          75.65100000000002,
          78.98,
          78.32,
          74.09,
          72.14,
          74.876,
          75.51,
          77.18,
          78.37,
          79.59,
          78.67,
          78.256,
          72.59,
          80.5,
          77.783,
          80.24,
          73.98100000000002,
          78.53,
          79.05,
          74.67,
          77.29,
          71.322,
          73.21300000000002,
          73.8,
          76.66,
          79.78,
          80.04,
          80.62,
          70.845,
          78.471
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "continent=Africa<br>gdpPercap=%{x}<br>lifeExp=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "marker": {
          "color": "#00cc96",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Africa",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          5288.040382,
          2773.287312,
          1372.877931,
          11003.60508,
          1037.645221,
          446.4035126,
          1934.011449,
          738.6906068,
          1156.18186,
          1075.811558,
          241.1658765,
          3484.06197,
          1648.800823,
          1908.260867,
          4754.604414,
          7703.4959,
          765.3500015,
          530.0535319,
          12521.71392,
          660.5855997,
          1111.9845779999996,
          945.5835837,
          575.7047176,
          1287.514732,
          1275.184575,
          531.4823679,
          9534.677467,
          894.6370822,
          665.4231186000002,
          951.4097518,
          1579.019543,
          9021.815894,
          3258.495584,
          633.6179466,
          4072.324751,
          601.0745012,
          1615.286395,
          6316.1652,
          785.6537647999999,
          1353.09239,
          1519.635262,
          699.4897129999998,
          882.0818218000002,
          7710.946444,
          1993.398314,
          4128.116943,
          899.0742111,
          886.2205765000001,
          5722.895654999998,
          927.7210018,
          1071.6139380000004,
          672.0386227000001
         ],
         "xaxis": "x",
         "y": [
          70.994,
          41.003,
          54.40600000000001,
          46.63399999999999,
          50.65,
          47.36,
          49.856,
          43.308,
          50.525,
          62.974,
          44.966,
          52.97,
          46.832,
          53.37300000000001,
          69.806,
          49.348,
          55.24,
          50.725,
          56.761,
          58.041,
          58.453,
          53.676,
          45.504,
          50.992,
          44.593,
          43.753,
          72.737,
          57.286,
          45.00899999999999,
          51.81800000000001,
          62.247,
          71.954,
          69.615,
          44.026,
          51.479,
          54.496,
          46.608,
          75.744,
          43.413,
          64.337,
          61.6,
          41.012,
          45.93600000000001,
          53.365,
          56.369,
          43.869,
          49.651,
          57.56100000000001,
          73.042,
          47.813,
          39.19300000000001,
          39.989
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "continent=Americas<br>gdpPercap=%{x}<br>lifeExp=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "marker": {
          "color": "#ab63fa",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Americas",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          8797.640716,
          3413.26269,
          8131.212843000001,
          33328.96507,
          10778.78385,
          5755.259962,
          7723.447195000002,
          6340.646683,
          4563.808154,
          5773.044512,
          5351.568665999999,
          4858.347495,
          1270.364932,
          3099.72866,
          6994.774861,
          10742.44053,
          2474.548819,
          7356.0319340000015,
          3783.674243,
          5909.020073,
          18855.60618,
          11460.60023,
          39097.09955,
          7727.002004000001,
          8605.047831
         ],
         "xaxis": "x",
         "y": [
          74.34,
          63.883,
          71.006,
          79.77,
          77.86,
          71.682,
          78.123,
          77.158,
          70.847,
          74.173,
          70.734,
          68.97800000000001,
          58.137,
          68.565,
          72.047,
          74.902,
          70.836,
          74.712,
          70.755,
          69.906,
          77.778,
          68.976,
          77.31,
          75.307,
          72.766
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "continent=Oceania<br>gdpPercap=%{x}<br>lifeExp=%{y}<extra></extra>",
         "legendgroup": "Oceania",
         "marker": {
          "color": "#FFA15A",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Oceania",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          30687.75473,
          23189.80135
         ],
         "xaxis": "x",
         "y": [
          80.37,
          79.11
         ],
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "title": {
          "text": "continent"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "gdpPercap"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "lifeExp"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.scatter(gapminder_2002,   # 传入的数据集\n",
    "           x=\"gdpPercap\",  # 横坐标是人均GDP\n",
    "           y=\"lifeExp\",  # 纵坐标是平均寿命\n",
    "           color=\"continent\"  # 颜色取值：根据洲的值来取\n",
    "          )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "continent=Asia<br>gdpPercap=%{x}<br>lifeExp=%{y}<br>pop=%{marker.size}<extra></extra>",
         "legendgroup": "Asia",
         "marker": {
          "color": "#636efa",
          "size": [
           25268405,
           656397,
           135656790,
           12926707,
           1280400000,
           6762476,
           1034172547,
           211060000,
           66907826,
           24001816,
           6029529,
           127065841,
           5307470,
           22215365,
           47969150,
           2111561,
           3677780,
           22662365,
           2674234,
           45598081,
           25873917,
           2713462,
           153403524,
           82995088,
           24501530,
           4197776,
           19576783,
           17155814,
           22454239,
           62806748,
           80908147,
           3389578,
           18701257
          ],
          "sizemode": "area",
          "sizeref": 355666.6666666667,
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Asia",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          726.7340548,
          23403.55927,
          1136.3904300000004,
          896.2260152999999,
          3119.280896,
          30209.015160000006,
          1746.769454,
          2873.91287,
          9240.761975,
          4390.717312,
          21905.59514,
          28604.5919,
          3844.917194,
          1646.758151,
          19233.98818,
          35110.10566,
          9313.93883,
          10206.97794,
          2140.739323,
          611,
          1057.206311,
          19774.83687,
          2092.712441,
          2650.921068,
          19014.54118,
          36023.1054,
          3015.378833,
          4090.925331,
          23235.42329,
          5913.187529,
          1764.456677,
          4515.487575,
          2234.820827
         ],
         "xaxis": "x",
         "y": [
          42.129,
          74.795,
          62.01300000000001,
          56.752,
          72.028,
          81.495,
          62.879,
          68.58800000000001,
          69.45100000000001,
          57.04600000000001,
          79.696,
          82,
          71.263,
          66.66199999999999,
          77.045,
          76.904,
          71.028,
          73.044,
          65.033,
          59.908,
          61.34,
          74.193,
          63.61,
          70.303,
          71.626,
          78.77,
          70.815,
          73.053,
          76.99,
          68.564,
          73.017,
          72.37,
          60.308
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "continent=Europe<br>gdpPercap=%{x}<br>lifeExp=%{y}<br>pop=%{marker.size}<extra></extra>",
         "legendgroup": "Europe",
         "marker": {
          "color": "#EF553B",
          "size": [
           3508512,
           8148312,
           10311970,
           4165416,
           7661799,
           4481020,
           10256295,
           5374693,
           5193039,
           59925035,
           82350671,
           10603863,
           10083313,
           288030,
           3879155,
           57926999,
           720230,
           16122830,
           4535591,
           38625976,
           10433867,
           22404337,
           10111559,
           5410052,
           2011497,
           40152517,
           8954175,
           7361757,
           67308928,
           59912431
          ],
          "sizemode": "area",
          "sizeref": 355666.6666666667,
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Europe",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          4604.211737,
          32417.60769,
          30485.88375,
          6018.975239,
          7696.777725,
          11628.38895,
          17596.210219999994,
          32166.50006,
          28204.59057,
          28926.03234,
          30035.80198,
          22514.2548,
          14843.93556,
          31163.20196,
          34077.04939,
          27968.09817,
          6557.194282,
          33724.75778,
          44683.97525,
          12002.23908,
          19970.90787,
          7885.360081,
          7236.075251,
          13638.778369999998,
          20660.01936,
          24835.47166,
          29341.630930000007,
          34480.95771,
          6508.085718,
          29478.99919
         ],
         "xaxis": "x",
         "y": [
          75.65100000000002,
          78.98,
          78.32,
          74.09,
          72.14,
          74.876,
          75.51,
          77.18,
          78.37,
          79.59,
          78.67,
          78.256,
          72.59,
          80.5,
          77.783,
          80.24,
          73.98100000000002,
          78.53,
          79.05,
          74.67,
          77.29,
          71.322,
          73.21300000000002,
          73.8,
          76.66,
          79.78,
          80.04,
          80.62,
          70.845,
          78.471
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "continent=Africa<br>gdpPercap=%{x}<br>lifeExp=%{y}<br>pop=%{marker.size}<extra></extra>",
         "legendgroup": "Africa",
         "marker": {
          "color": "#00cc96",
          "size": [
           31287142,
           10866106,
           7026113,
           1630347,
           12251209,
           7021078,
           15929988,
           4048013,
           8835739,
           614382,
           55379852,
           3328795,
           16252726,
           447416,
           73312559,
           495627,
           4414865,
           67946797,
           1299304,
           1457766,
           20550751,
           8807818,
           1332459,
           31386842,
           2046772,
           2814651,
           5368585,
           16473477,
           11824495,
           10580176,
           2828858,
           1200206,
           31167783,
           18473780,
           1972153,
           11140655,
           119901274,
           743981,
           7852401,
           170372,
           10870037,
           5359092,
           7753310,
           44433622,
           37090298,
           1130269,
           34593779,
           4977378,
           9770575,
           24739869,
           10595811,
           11926563
          ],
          "sizemode": "area",
          "sizeref": 355666.6666666667,
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Africa",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          5288.040382,
          2773.287312,
          1372.877931,
          11003.60508,
          1037.645221,
          446.4035126,
          1934.011449,
          738.6906068,
          1156.18186,
          1075.811558,
          241.1658765,
          3484.06197,
          1648.800823,
          1908.260867,
          4754.604414,
          7703.4959,
          765.3500015,
          530.0535319,
          12521.71392,
          660.5855997,
          1111.9845779999996,
          945.5835837,
          575.7047176,
          1287.514732,
          1275.184575,
          531.4823679,
          9534.677467,
          894.6370822,
          665.4231186000002,
          951.4097518,
          1579.019543,
          9021.815894,
          3258.495584,
          633.6179466,
          4072.324751,
          601.0745012,
          1615.286395,
          6316.1652,
          785.6537647999999,
          1353.09239,
          1519.635262,
          699.4897129999998,
          882.0818218000002,
          7710.946444,
          1993.398314,
          4128.116943,
          899.0742111,
          886.2205765000001,
          5722.895654999998,
          927.7210018,
          1071.6139380000004,
          672.0386227000001
         ],
         "xaxis": "x",
         "y": [
          70.994,
          41.003,
          54.40600000000001,
          46.63399999999999,
          50.65,
          47.36,
          49.856,
          43.308,
          50.525,
          62.974,
          44.966,
          52.97,
          46.832,
          53.37300000000001,
          69.806,
          49.348,
          55.24,
          50.725,
          56.761,
          58.041,
          58.453,
          53.676,
          45.504,
          50.992,
          44.593,
          43.753,
          72.737,
          57.286,
          45.00899999999999,
          51.81800000000001,
          62.247,
          71.954,
          69.615,
          44.026,
          51.479,
          54.496,
          46.608,
          75.744,
          43.413,
          64.337,
          61.6,
          41.012,
          45.93600000000001,
          53.365,
          56.369,
          43.869,
          49.651,
          57.56100000000001,
          73.042,
          47.813,
          39.19300000000001,
          39.989
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "continent=Americas<br>gdpPercap=%{x}<br>lifeExp=%{y}<br>pop=%{marker.size}<extra></extra>",
         "legendgroup": "Americas",
         "marker": {
          "color": "#ab63fa",
          "size": [
           38331121,
           8445134,
           179914212,
           31902268,
           15497046,
           41008227,
           3834934,
           11226999,
           8650322,
           12921234,
           6353681,
           11178650,
           7607651,
           6677328,
           2664659,
           102479927,
           5146848,
           2990875,
           5884491,
           26769436,
           3859606,
           1101832,
           287675526,
           3363085,
           24287670
          ],
          "sizemode": "area",
          "sizeref": 355666.6666666667,
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Americas",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          8797.640716,
          3413.26269,
          8131.212843000001,
          33328.96507,
          10778.78385,
          5755.259962,
          7723.447195000002,
          6340.646683,
          4563.808154,
          5773.044512,
          5351.568665999999,
          4858.347495,
          1270.364932,
          3099.72866,
          6994.774861,
          10742.44053,
          2474.548819,
          7356.0319340000015,
          3783.674243,
          5909.020073,
          18855.60618,
          11460.60023,
          39097.09955,
          7727.002004000001,
          8605.047831
         ],
         "xaxis": "x",
         "y": [
          74.34,
          63.883,
          71.006,
          79.77,
          77.86,
          71.682,
          78.123,
          77.158,
          70.847,
          74.173,
          70.734,
          68.97800000000001,
          58.137,
          68.565,
          72.047,
          74.902,
          70.836,
          74.712,
          70.755,
          69.906,
          77.778,
          68.976,
          77.31,
          75.307,
          72.766
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "continent=Oceania<br>gdpPercap=%{x}<br>lifeExp=%{y}<br>pop=%{marker.size}<extra></extra>",
         "legendgroup": "Oceania",
         "marker": {
          "color": "#FFA15A",
          "size": [
           19546792,
           3908037
          ],
          "sizemode": "area",
          "sizeref": 355666.6666666667,
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "Oceania",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          30687.75473,
          23189.80135
         ],
         "xaxis": "x",
         "y": [
          80.37,
          79.11
         ],
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "itemsizing": "constant",
         "title": {
          "text": "continent"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "gdpPercap"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "lifeExp"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.scatter(gapminder_2002   # 绘图数据集\n",
    "           ,x=\"gdpPercap\"  # 横坐标\n",
    "           ,y=\"lifeExp\"  # 纵坐标\n",
    "           ,color=\"continent\"  # 区分颜色\n",
    "           ,size=\"pop\"   # 区分圆的大小\n",
    "           ,size_max=60  # 散点大小\n",
    "          )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "mode": "lines",
         "name": "lines",
         "type": "scatter",
         "x": [
          0,
          0.02040816326530612,
          0.04081632653061224,
          0.061224489795918366,
          0.08163265306122448,
          0.1020408163265306,
          0.12244897959183673,
          0.14285714285714285,
          0.16326530612244897,
          0.18367346938775508,
          0.2040816326530612,
          0.22448979591836732,
          0.24489795918367346,
          0.26530612244897955,
          0.2857142857142857,
          0.3061224489795918,
          0.32653061224489793,
          0.3469387755102041,
          0.36734693877551017,
          0.3877551020408163,
          0.4081632653061224,
          0.42857142857142855,
          0.44897959183673464,
          0.4693877551020408,
          0.4897959183673469,
          0.5102040816326531,
          0.5306122448979591,
          0.5510204081632653,
          0.5714285714285714,
          0.5918367346938775,
          0.6122448979591836,
          0.6326530612244897,
          0.6530612244897959,
          0.673469387755102,
          0.6938775510204082,
          0.7142857142857142,
          0.7346938775510203,
          0.7551020408163265,
          0.7755102040816326,
          0.7959183673469387,
          0.8163265306122448,
          0.836734693877551,
          0.8571428571428571,
          0.8775510204081632,
          0.8979591836734693,
          0.9183673469387754,
          0.9387755102040816,
          0.9591836734693877,
          0.9795918367346939,
          1
         ],
         "y": [
          10.699120489265093,
          8.139987238046187,
          11.906701552909276,
          10.631602708169549,
          10.06184036448616,
          10.471893306676655,
          12.58225427369264,
          10.536220266859731,
          10.464340286649595,
          9.04680713677051,
          12.129774001833017,
          10.41755921193808,
          9.261747365962584,
          11.248817140571887,
          9.185902599603688,
          9.37590754399761,
          9.364066770547723,
          10.819026890968207,
          9.231736299642417,
          10.981461756456524,
          11.54595966207394,
          10.02332348604474,
          9.67283728168137,
          10.441941788068661,
          10.758361043243713,
          11.468881574610274,
          11.319763058791093,
          9.780717062639361,
          9.904464242671478,
          9.933588254501048,
          10.241560243542489,
          9.532129762569548,
          9.733244902264353,
          10.071658294014526,
          9.318196695018559,
          10.760608496552459,
          11.696056234678005,
          10.17667173798547,
          11.843686970512252,
          10.701253455162108,
          10.545341794305783,
          8.628318580669559,
          10.00042706526311,
          8.299318435755396,
          8.967670328067623,
          9.64450848205639,
          8.651744839938646,
          9.931570561242177,
          11.897463077881529,
          9.368156014329257
         ]
        },
        {
         "mode": "lines+markers",
         "name": "lines+markers",
         "type": "scatter",
         "x": [
          0,
          0.02040816326530612,
          0.04081632653061224,
          0.061224489795918366,
          0.08163265306122448,
          0.1020408163265306,
          0.12244897959183673,
          0.14285714285714285,
          0.16326530612244897,
          0.18367346938775508,
          0.2040816326530612,
          0.22448979591836732,
          0.24489795918367346,
          0.26530612244897955,
          0.2857142857142857,
          0.3061224489795918,
          0.32653061224489793,
          0.3469387755102041,
          0.36734693877551017,
          0.3877551020408163,
          0.4081632653061224,
          0.42857142857142855,
          0.44897959183673464,
          0.4693877551020408,
          0.4897959183673469,
          0.5102040816326531,
          0.5306122448979591,
          0.5510204081632653,
          0.5714285714285714,
          0.5918367346938775,
          0.6122448979591836,
          0.6326530612244897,
          0.6530612244897959,
          0.673469387755102,
          0.6938775510204082,
          0.7142857142857142,
          0.7346938775510203,
          0.7551020408163265,
          0.7755102040816326,
          0.7959183673469387,
          0.8163265306122448,
          0.836734693877551,
          0.8571428571428571,
          0.8775510204081632,
          0.8979591836734693,
          0.9183673469387754,
          0.9387755102040816,
          0.9591836734693877,
          0.9795918367346939,
          1
         ],
         "y": [
          -0.19804423081495923,
          1.44509147013151,
          -1.861992178195979,
          -0.5862626066394544,
          0.681707986492744,
          0.6125840418699212,
          -0.14423881388396192,
          -0.8737651074223671,
          -1.7031898289023784,
          0.2764415370385277,
          -1.7194265925035999,
          0.8544861526434584,
          0.588730567502197,
          0.17812607885221157,
          0.25004076809487175,
          -0.41570476347760194,
          0.3362595814478144,
          0.9514388010991003,
          -0.8464888208459684,
          0.9316594160935375,
          0.174141851311221,
          0.22714262979127678,
          -1.3231764395551373,
          0.6841927928575134,
          0.886653217381597,
          -0.9750496555053745,
          -0.00742294069484559,
          -0.6292476979004127,
          -0.6594918355303944,
          0.4794243851456772,
          -1.576292228591823,
          -0.7330223401093173,
          -0.5642368967224414,
          -0.24123228164063018,
          -0.26442509320658325,
          0.9326224432069595,
          -1.1078510449752923,
          -0.25097872367555646,
          0.8247620457370282,
          -1.1661013790880377,
          1.0659008339135094,
          -0.28543427853637476,
          1.0525782046073087,
          -1.5166578941566184,
          -1.078301090445865,
          -1.1902687047534994,
          2.5675215843048527,
          -0.6688023506340743,
          -1.4071570144741519,
          -0.9723951054714547
         ]
        },
        {
         "mode": "markers",
         "name": "markers",
         "type": "scatter",
         "x": [
          0,
          0.02040816326530612,
          0.04081632653061224,
          0.061224489795918366,
          0.08163265306122448,
          0.1020408163265306,
          0.12244897959183673,
          0.14285714285714285,
          0.16326530612244897,
          0.18367346938775508,
          0.2040816326530612,
          0.22448979591836732,
          0.24489795918367346,
          0.26530612244897955,
          0.2857142857142857,
          0.3061224489795918,
          0.32653061224489793,
          0.3469387755102041,
          0.36734693877551017,
          0.3877551020408163,
          0.4081632653061224,
          0.42857142857142855,
          0.44897959183673464,
          0.4693877551020408,
          0.4897959183673469,
          0.5102040816326531,
          0.5306122448979591,
          0.5510204081632653,
          0.5714285714285714,
          0.5918367346938775,
          0.6122448979591836,
          0.6326530612244897,
          0.6530612244897959,
          0.673469387755102,
          0.6938775510204082,
          0.7142857142857142,
          0.7346938775510203,
          0.7551020408163265,
          0.7755102040816326,
          0.7959183673469387,
          0.8163265306122448,
          0.836734693877551,
          0.8571428571428571,
          0.8775510204081632,
          0.8979591836734693,
          0.9183673469387754,
          0.9387755102040816,
          0.9591836734693877,
          0.9795918367346939,
          1
         ],
         "y": [
          -11.822990690168252,
          -10.80533579355843,
          -9.342650148156714,
          -9.911522653129401,
          -9.853307550778544,
          -8.963004316039283,
          -11.52524053476465,
          -11.586419023192562,
          -9.21198887091281,
          -9.9808177685669,
          -9.242679250636165,
          -10.200174940634424,
          -9.977186010163116,
          -11.422437769809838,
          -9.66200169761541,
          -10.236295125728708,
          -9.598485489168176,
          -9.846497146847843,
          -10.614109935415557,
          -8.266841987764124,
          -9.927060052151909,
          -10.139337816928096,
          -9.050007320828582,
          -9.76786412846539,
          -9.77456054207998,
          -10.334804516067283,
          -10.757361441120958,
          -9.918987928216897,
          -10.913137993734312,
          -10.43563429722324,
          -9.755875470499744,
          -11.602479047622708,
          -8.642682112650082,
          -10.479556892185046,
          -9.30668419848835,
          -10.790417996969328,
          -9.243619695602723,
          -10.09843068724457,
          -10.459120077788077,
          -9.869928802792609,
          -8.55313314651869,
          -9.482549601521827,
          -10.559314922973524,
          -8.306422756227914,
          -9.828828931129353,
          -9.794872238015556,
          -9.15454427002911,
          -9.532557298226749,
          -9.88231318810749,
          -10.52175278299977
         ]
        }
       ],
       "layout": {
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 生成随机数据\n",
    "N = 50\n",
    "random_x = np.linspace(0, 1, N)\n",
    "random_y0 = np.random.randn(N) + 10\n",
    "random_y1 = np.random.randn(N)\n",
    "random_y2 = np.random.randn(N) - 10\n",
    "\n",
    "# 准备画布\n",
    "fig = go.Figure()\n",
    "\n",
    "# 添加3组不同的数据轨迹\n",
    "fig.add_trace(go.Scatter(  #\n",
    "    x=random_x,\n",
    "    y=random_y0,\n",
    "    mode='lines', # mode模式选择\n",
    "    name='lines')) # 名字\n",
    "\n",
    "fig.add_trace(go.Scatter(\n",
    "    x=random_x,\n",
    "    y=random_y1,\n",
    "    mode='lines+markers',\n",
    "    name='lines+markers'))\n",
    "\n",
    "fig.add_trace(go.Scatter(\n",
    "    x=random_x,\n",
    "    y=random_y2,\n",
    "    mode='markers',\n",
    "    name='markers'))\n",
    "\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 面积图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>country</th>\n",
       "      <th>continent</th>\n",
       "      <th>year</th>\n",
       "      <th>lifeExp</th>\n",
       "      <th>pop</th>\n",
       "      <th>gdpPercap</th>\n",
       "      <th>iso_alpha</th>\n",
       "      <th>iso_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1952</td>\n",
       "      <td>28.801</td>\n",
       "      <td>8425333</td>\n",
       "      <td>779.445314</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1957</td>\n",
       "      <td>30.332</td>\n",
       "      <td>9240934</td>\n",
       "      <td>820.853030</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1962</td>\n",
       "      <td>31.997</td>\n",
       "      <td>10267083</td>\n",
       "      <td>853.100710</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1967</td>\n",
       "      <td>34.020</td>\n",
       "      <td>11537966</td>\n",
       "      <td>836.197138</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Afghanistan</td>\n",
       "      <td>Asia</td>\n",
       "      <td>1972</td>\n",
       "      <td>36.088</td>\n",
       "      <td>13079460</td>\n",
       "      <td>739.981106</td>\n",
       "      <td>AFG</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       country continent  year  lifeExp       pop   gdpPercap iso_alpha  \\\n",
       "0  Afghanistan      Asia  1952   28.801   8425333  779.445314       AFG   \n",
       "1  Afghanistan      Asia  1957   30.332   9240934  820.853030       AFG   \n",
       "2  Afghanistan      Asia  1962   31.997  10267083  853.100710       AFG   \n",
       "3  Afghanistan      Asia  1967   34.020  11537966  836.197138       AFG   \n",
       "4  Afghanistan      Asia  1972   36.088  13079460  739.981106       AFG   \n",
       "\n",
       "   iso_num  \n",
       "0        4  \n",
       "1        4  \n",
       "2        4  \n",
       "3        4  \n",
       "4        4  "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "gapminder.head()   # gdp数据集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Afghanistan<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": true,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8425333,
          9240934,
          10267083,
          11537966,
          13079460,
          14880372,
          12881816,
          13867957,
          16317921,
          22227415,
          25268405,
          31889923
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Bahrain<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          120447,
          138655,
          171863,
          202182,
          230800,
          297410,
          377967,
          454612,
          529491,
          598561,
          656397,
          708573
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Bangladesh<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          46886859,
          51365468,
          56839289,
          62821884,
          70759295,
          80428306,
          93074406,
          103764241,
          113704579,
          123315288,
          135656790,
          150448339
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Cambodia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4693836,
          5322536,
          6083619,
          6960067,
          7450606,
          6978607,
          7272485,
          8371791,
          10150094,
          11782962,
          12926707,
          14131858
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=China<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          556263527,
          637408000,
          665770000,
          754550000,
          862030000,
          943455000,
          1000281000,
          1084035000,
          1164970000,
          1230075000,
          1280400000,
          1318683096
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Hong Kong, China<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2125900,
          2736300,
          3305200,
          3722800,
          4115700,
          4583700,
          5264500,
          5584510,
          5829696,
          6495918,
          6762476,
          6980412
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=India<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          372000000,
          409000000,
          454000000,
          506000000,
          567000000,
          634000000,
          708000000,
          788000000,
          872000000,
          959000000,
          1034172547,
          1110396331
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Indonesia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          82052000,
          90124000,
          99028000,
          109343000,
          121282000,
          136725000,
          153343000,
          169276000,
          184816000,
          199278000,
          211060000,
          223547000
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Iran<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          17272000,
          19792000,
          22874000,
          26538000,
          30614000,
          35480679,
          43072751,
          51889696,
          60397973,
          63327987,
          66907826,
          69453570
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Iraq<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          5441766,
          6248643,
          7240260,
          8519282,
          10061506,
          11882916,
          14173318,
          16543189,
          17861905,
          20775703,
          24001816,
          27499638
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Israel<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1620914,
          1944401,
          2310904,
          2693585,
          3095893,
          3495918,
          3858421,
          4203148,
          4936550,
          5531387,
          6029529,
          6426679
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Japan<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          86459025,
          91563009,
          95831757,
          100825279,
          107188273,
          113872473,
          118454974,
          122091325,
          124329269,
          125956499,
          127065841,
          127467972
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Jordan<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          607914,
          746559,
          933559,
          1255058,
          1613551,
          1937652,
          2347031,
          2820042,
          3867409,
          4526235,
          5307470,
          6053193
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Korea, Dem. Rep.<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8865488,
          9411381,
          10917494,
          12617009,
          14781241,
          16325320,
          17647518,
          19067554,
          20711375,
          21585105,
          22215365,
          23301725
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Korea, Rep.<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          20947571,
          22611552,
          26420307,
          30131000,
          33505000,
          36436000,
          39326000,
          41622000,
          43805450,
          46173816,
          47969150,
          49044790
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Kuwait<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          160000,
          212846,
          358266,
          575003,
          841934,
          1140357,
          1497494,
          1891487,
          1418095,
          1765345,
          2111561,
          2505559
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Lebanon<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1439529,
          1647412,
          1886848,
          2186894,
          2680018,
          3115787,
          3086876,
          3089353,
          3219994,
          3430388,
          3677780,
          3921278
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Malaysia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          6748378,
          7739235,
          8906385,
          10154878,
          11441462,
          12845381,
          14441916,
          16331785,
          18319502,
          20476091,
          22662365,
          24821286
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Mongolia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          800663,
          882134,
          1010280,
          1149500,
          1320500,
          1528000,
          1756032,
          2015133,
          2312802,
          2494803,
          2674234,
          2874127
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Myanmar<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          20092996,
          21731844,
          23634436,
          25870271,
          28466390,
          31528087,
          34680442,
          38028578,
          40546538,
          43247867,
          45598081,
          47761980
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Nepal<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          9182536,
          9682338,
          10332057,
          11261690,
          12412593,
          13933198,
          15796314,
          17917180,
          20326209,
          23001113,
          25873917,
          28901790
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Oman<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          507833,
          561977,
          628164,
          714775,
          829050,
          1004533,
          1301048,
          1593882,
          1915208,
          2283635,
          2713462,
          3204897
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Pakistan<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          41346560,
          46679944,
          53100671,
          60641899,
          69325921,
          78152686,
          91462088,
          105186881,
          120065004,
          135564834,
          153403524,
          169270617
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Philippines<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          22438691,
          26072194,
          30325264,
          35356600,
          40850141,
          46850962,
          53456774,
          60017788,
          67185766,
          75012988,
          82995088,
          91077287
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Saudi Arabia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4005677,
          4419650,
          4943029,
          5618198,
          6472756,
          8128505,
          11254672,
          14619745,
          16945857,
          21229759,
          24501530,
          27601038
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Singapore<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1127000,
          1445929,
          1750200,
          1977600,
          2152400,
          2325300,
          2651869,
          2794552,
          3235865,
          3802309,
          4197776,
          4553009
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Sri Lanka<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          7982342,
          9128546,
          10421936,
          11737396,
          13016733,
          14116836,
          15410151,
          16495304,
          17587060,
          18698655,
          19576783,
          20378239
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Syria<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3661549,
          4149908,
          4834621,
          5680812,
          6701172,
          7932503,
          9410494,
          11242847,
          13219062,
          15081016,
          17155814,
          19314747
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Taiwan<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8550362,
          10164215,
          11918938,
          13648692,
          15226039,
          16785196,
          18501390,
          19757799,
          20686918,
          21628605,
          22454239,
          23174294
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Thailand<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          21289402,
          25041917,
          29263397,
          34024249,
          39276153,
          44148285,
          48827160,
          52910342,
          56667095,
          60216677,
          62806748,
          65068149
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Vietnam<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          26246839,
          28998543,
          33796140,
          39463910,
          44655014,
          50533506,
          56142181,
          62826491,
          69940728,
          76048996,
          80908147,
          85262356
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=West Bank and Gaza<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1030585,
          1070439,
          1133134,
          1142636,
          1089572,
          1261091,
          1425876,
          1691210,
          2104779,
          2826046,
          3389578,
          4018332
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Asia<br>country=Yemen, Rep.<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Asia",
         "line": {
          "color": "#636efa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Asia",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4963829,
          5498090,
          6120081,
          6740785,
          7407075,
          8403990,
          9657618,
          11219340,
          13367997,
          15826497,
          18701257,
          22211743
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Albania<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": true,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1282697,
          1476505,
          1728137,
          1984060,
          2263554,
          2509048,
          2780097,
          3075321,
          3326498,
          3428038,
          3508512,
          3600523
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Austria<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          6927772,
          6965860,
          7129864,
          7376998,
          7544201,
          7568430,
          7574613,
          7578903,
          7914969,
          8069876,
          8148312,
          8199783
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Belgium<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8730405,
          8989111,
          9218400,
          9556500,
          9709100,
          9821800,
          9856303,
          9870200,
          10045622,
          10199787,
          10311970,
          10392226
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Bosnia and Herzegovina<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2791000,
          3076000,
          3349000,
          3585000,
          3819000,
          4086000,
          4172693,
          4338977,
          4256013,
          3607000,
          4165416,
          4552198
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Bulgaria<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          7274900,
          7651254,
          8012946,
          8310226,
          8576200,
          8797022,
          8892098,
          8971958,
          8658506,
          8066057,
          7661799,
          7322858
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Croatia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3882229,
          3991242,
          4076557,
          4174366,
          4225310,
          4318673,
          4413368,
          4484310,
          4494013,
          4444595,
          4481020,
          4493312
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Czech Republic<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          9125183,
          9513758,
          9620282,
          9835109,
          9862158,
          10161915,
          10303704,
          10311597,
          10315702,
          10300707,
          10256295,
          10228744
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Denmark<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4334000,
          4487831,
          4646899,
          4838800,
          4991596,
          5088419,
          5117810,
          5127024,
          5171393,
          5283663,
          5374693,
          5468120
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Finland<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4090500,
          4324000,
          4491443,
          4605744,
          4639657,
          4738902,
          4826933,
          4931729,
          5041039,
          5134406,
          5193039,
          5238460
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=France<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          42459667,
          44310863,
          47124000,
          49569000,
          51732000,
          53165019,
          54433565,
          55630100,
          57374179,
          58623428,
          59925035,
          61083916
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Germany<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          69145952,
          71019069,
          73739117,
          76368453,
          78717088,
          78160773,
          78335266,
          77718298,
          80597764,
          82011073,
          82350671,
          82400996
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Greece<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          7733250,
          8096218,
          8448233,
          8716441,
          8888628,
          9308479,
          9786480,
          9974490,
          10325429,
          10502372,
          10603863,
          10706290
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Hungary<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          9504000,
          9839000,
          10063000,
          10223422,
          10394091,
          10637171,
          10705535,
          10612740,
          10348684,
          10244684,
          10083313,
          9956108
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Iceland<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          147962,
          165110,
          182053,
          198676,
          209275,
          221823,
          233997,
          244676,
          259012,
          271192,
          288030,
          301931
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Ireland<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2952156,
          2878220,
          2830000,
          2900100,
          3024400,
          3271900,
          3480000,
          3539900,
          3557761,
          3667233,
          3879155,
          4109086
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Italy<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          47666000,
          49182000,
          50843200,
          52667100,
          54365564,
          56059245,
          56535636,
          56729703,
          56840847,
          57479469,
          57926999,
          58147733
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Montenegro<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          413834,
          442829,
          474528,
          501035,
          527678,
          560073,
          562548,
          569473,
          621621,
          692651,
          720230,
          684736
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Netherlands<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          10381988,
          11026383,
          11805689,
          12596822,
          13329874,
          13852989,
          14310401,
          14665278,
          15174244,
          15604464,
          16122830,
          16570613
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Norway<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3327728,
          3491938,
          3638919,
          3786019,
          3933004,
          4043205,
          4114787,
          4186147,
          4286357,
          4405672,
          4535591,
          4627926
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Poland<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          25730551,
          28235346,
          30329617,
          31785378,
          33039545,
          34621254,
          36227381,
          37740710,
          38370697,
          38654957,
          38625976,
          38518241
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Portugal<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8526050,
          8817650,
          9019800,
          9103000,
          8970450,
          9662600,
          9859650,
          9915289,
          9927680,
          10156415,
          10433867,
          10642836
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Romania<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          16630000,
          17829327,
          18680721,
          19284814,
          20662648,
          21658597,
          22356726,
          22686371,
          22797027,
          22562458,
          22404337,
          22276056
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Serbia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          6860147,
          7271135,
          7616060,
          7971222,
          8313288,
          8686367,
          9032824,
          9230783,
          9826397,
          10336594,
          10111559,
          10150265
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Slovak Republic<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3558137,
          3844277,
          4237384,
          4442238,
          4593433,
          4827803,
          5048043,
          5199318,
          5302888,
          5383010,
          5410052,
          5447502
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Slovenia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1489518,
          1533070,
          1582962,
          1646912,
          1694510,
          1746919,
          1861252,
          1945870,
          1999210,
          2011612,
          2011497,
          2009245
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Spain<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          28549870,
          29841614,
          31158061,
          32850275,
          34513161,
          36439000,
          37983310,
          38880702,
          39549438,
          39855442,
          40152517,
          40448191
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Sweden<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          7124673,
          7363802,
          7561588,
          7867931,
          8122293,
          8251648,
          8325260,
          8421403,
          8718867,
          8897619,
          8954175,
          9031088
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Switzerland<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4815000,
          5126000,
          5666000,
          6063000,
          6401400,
          6316424,
          6468126,
          6649942,
          6995447,
          7193761,
          7361757,
          7554661
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=Turkey<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          22235677,
          25670939,
          29788695,
          33411317,
          37492953,
          42404033,
          47328791,
          52881328,
          58179144,
          63047647,
          67308928,
          71158647
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Europe<br>country=United Kingdom<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Europe",
         "line": {
          "color": "#EF553B"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Europe",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          50430000,
          51430000,
          53292000,
          54959000,
          56079000,
          56179000,
          56339704,
          56981620,
          57866349,
          58808266,
          59912431,
          60776238
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Algeria<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": true,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          9279525,
          10270856,
          11000948,
          12760499,
          14760787,
          17152804,
          20033753,
          23254956,
          26298373,
          29072015,
          31287142,
          33333216
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Angola<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4232095,
          4561361,
          4826015,
          5247469,
          5894858,
          6162675,
          7016384,
          7874230,
          8735988,
          9875024,
          10866106,
          12420476
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Benin<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1738315,
          1925173,
          2151895,
          2427334,
          2761407,
          3168267,
          3641603,
          4243788,
          4981671,
          6066080,
          7026113,
          8078314
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Botswana<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          442308,
          474639,
          512764,
          553541,
          619351,
          781472,
          970347,
          1151184,
          1342614,
          1536536,
          1630347,
          1639131
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Burkina Faso<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4469979,
          4713416,
          4919632,
          5127935,
          5433886,
          5889574,
          6634596,
          7586551,
          8878303,
          10352843,
          12251209,
          14326203
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Burundi<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2445618,
          2667518,
          2961915,
          3330989,
          3529983,
          3834415,
          4580410,
          5126023,
          5809236,
          6121610,
          7021078,
          8390505
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Cameroon<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          5009067,
          5359923,
          5793633,
          6335506,
          7021028,
          7959865,
          9250831,
          10780667,
          12467171,
          14195809,
          15929988,
          17696293
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Central African Republic<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1291695,
          1392284,
          1523478,
          1733638,
          1927260,
          2167533,
          2476971,
          2840009,
          3265124,
          3696513,
          4048013,
          4369038
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Chad<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2682462,
          2894855,
          3150417,
          3495967,
          3899068,
          4388260,
          4875118,
          5498955,
          6429417,
          7562011,
          8835739,
          10238807
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Comoros<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          153936,
          170928,
          191689,
          217378,
          250027,
          304739,
          348643,
          395114,
          454429,
          527982,
          614382,
          710960
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Congo, Dem. Rep.<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          14100005,
          15577932,
          17486434,
          19941073,
          23007669,
          26480870,
          30646495,
          35481645,
          41672143,
          47798986,
          55379852,
          64606759
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Congo, Rep.<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          854885,
          940458,
          1047924,
          1179760,
          1340458,
          1536769,
          1774735,
          2064095,
          2409073,
          2800947,
          3328795,
          3800610
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Cote d'Ivoire<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2977019,
          3300000,
          3832408,
          4744870,
          6071696,
          7459574,
          9025951,
          10761098,
          12772596,
          14625967,
          16252726,
          18013409
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Djibouti<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          63149,
          71851,
          89898,
          127617,
          178848,
          228694,
          305991,
          311025,
          384156,
          417908,
          447416,
          496374
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Egypt<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          22223309,
          25009741,
          28173309,
          31681188,
          34807417,
          38783863,
          45681811,
          52799062,
          59402198,
          66134291,
          73312559,
          80264543
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Equatorial Guinea<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          216964,
          232922,
          249220,
          259864,
          277603,
          192675,
          285483,
          341244,
          387838,
          439971,
          495627,
          551201
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Eritrea<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1438760,
          1542611,
          1666618,
          1820319,
          2260187,
          2512642,
          2637297,
          2915959,
          3668440,
          4058319,
          4414865,
          4906585
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Ethiopia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          20860941,
          22815614,
          25145372,
          27860297,
          30770372,
          34617799,
          38111756,
          42999530,
          52088559,
          59861301,
          67946797,
          76511887
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Gabon<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          420702,
          434904,
          455661,
          489004,
          537977,
          706367,
          753874,
          880397,
          985739,
          1126189,
          1299304,
          1454867
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Gambia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          284320,
          323150,
          374020,
          439593,
          517101,
          608274,
          715523,
          848406,
          1025384,
          1235767,
          1457766,
          1688359
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Ghana<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          5581001,
          6391288,
          7355248,
          8490213,
          9354120,
          10538093,
          11400338,
          14168101,
          16278738,
          18418288,
          20550751,
          22873338
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Guinea<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2664249,
          2876726,
          3140003,
          3451418,
          3811387,
          4227026,
          4710497,
          5650262,
          6990574,
          8048834,
          8807818,
          9947814
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Guinea-Bissau<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          580653,
          601095,
          627820,
          601287,
          625361,
          745228,
          825987,
          927524,
          1050938,
          1193708,
          1332459,
          1472041
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Kenya<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          6464046,
          7454779,
          8678557,
          10191512,
          12044785,
          14500404,
          17661452,
          21198082,
          25020539,
          28263827,
          31386842,
          35610177
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Lesotho<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          748747,
          813338,
          893143,
          996380,
          1116779,
          1251524,
          1411807,
          1599200,
          1803195,
          1982823,
          2046772,
          2012649
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Liberia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          863308,
          975950,
          1112796,
          1279406,
          1482628,
          1703617,
          1956875,
          2269414,
          1912974,
          2200725,
          2814651,
          3193942
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Libya<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1019729,
          1201578,
          1441863,
          1759224,
          2183877,
          2721783,
          3344074,
          3799845,
          4364501,
          4759670,
          5368585,
          6036914
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Madagascar<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          4762912,
          5181679,
          5703324,
          6334556,
          7082430,
          8007166,
          9171477,
          10568642,
          12210395,
          14165114,
          16473477,
          19167654
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Malawi<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2917802,
          3221238,
          3628608,
          4147252,
          4730997,
          5637246,
          6502825,
          7824747,
          10014249,
          10419991,
          11824495,
          13327079
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Mali<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3838168,
          4241884,
          4690372,
          5212416,
          5828158,
          6491649,
          6998256,
          7634008,
          8416215,
          9384984,
          10580176,
          12031795
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Mauritania<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1022556,
          1076852,
          1146757,
          1230542,
          1332786,
          1456688,
          1622136,
          1841240,
          2119465,
          2444741,
          2828858,
          3270065
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Mauritius<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          516556,
          609816,
          701016,
          789309,
          851334,
          913025,
          992040,
          1042663,
          1096202,
          1149818,
          1200206,
          1250882
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Morocco<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          9939217,
          11406350,
          13056604,
          14770296,
          16660670,
          18396941,
          20198730,
          22987397,
          25798239,
          28529501,
          31167783,
          33757175
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Mozambique<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          6446316,
          7038035,
          7788944,
          8680909,
          9809596,
          11127868,
          12587223,
          12891952,
          13160731,
          16603334,
          18473780,
          19951656
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Namibia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          485831,
          548080,
          621392,
          706640,
          821782,
          977026,
          1099010,
          1278184,
          1554253,
          1774766,
          1972153,
          2055080
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Niger<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3379468,
          3692184,
          4076008,
          4534062,
          5060262,
          5682086,
          6437188,
          7332638,
          8392818,
          9666252,
          11140655,
          12894865
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Nigeria<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          33119096,
          37173340,
          41871351,
          47287752,
          53740085,
          62209173,
          73039376,
          81551520,
          93364244,
          106207839,
          119901274,
          135031164
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Reunion<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          257700,
          308700,
          358900,
          414024,
          461633,
          492095,
          517810,
          562035,
          622191,
          684810,
          743981,
          798094
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Rwanda<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2534927,
          2822082,
          3051242,
          3451079,
          3992121,
          4657072,
          5507565,
          6349365,
          7290203,
          7212583,
          7852401,
          8860588
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Sao Tome and Principe<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          60011,
          61325,
          65345,
          70787,
          76595,
          86796,
          98593,
          110812,
          125911,
          145608,
          170372,
          199579
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Senegal<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2755589,
          3054547,
          3430243,
          3965841,
          4588696,
          5260855,
          6147783,
          7171347,
          8307920,
          9535314,
          10870037,
          12267493
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Sierra Leone<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2143249,
          2295678,
          2467895,
          2662190,
          2879013,
          3140897,
          3464522,
          3868905,
          4260884,
          4578212,
          5359092,
          6144562
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Somalia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2526994,
          2780415,
          3080153,
          3428839,
          3840161,
          4353666,
          5828892,
          6921858,
          6099799,
          6633514,
          7753310,
          9118773
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=South Africa<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          14264935,
          16151549,
          18356657,
          20997321,
          23935810,
          27129932,
          31140029,
          35933379,
          39964159,
          42835005,
          44433622,
          43997828
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Sudan<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8504667,
          9753392,
          11183227,
          12716129,
          14597019,
          17104986,
          20367053,
          24725960,
          28227588,
          32160729,
          37090298,
          42292929
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Swaziland<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          290243,
          326741,
          370006,
          420690,
          480105,
          551425,
          649901,
          779348,
          962344,
          1054486,
          1130269,
          1133066
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Tanzania<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8322925,
          9452826,
          10863958,
          12607312,
          14706593,
          17129565,
          19844382,
          23040630,
          26605473,
          30686889,
          34593779,
          38139640
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Togo<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1219113,
          1357445,
          1528098,
          1735550,
          2056351,
          2308582,
          2644765,
          3154264,
          3747553,
          4320890,
          4977378,
          5701579
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Tunisia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3647735,
          3950849,
          4286552,
          4786986,
          5303507,
          6005061,
          6734098,
          7724976,
          8523077,
          9231669,
          9770575,
          10276158
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Uganda<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          5824797,
          6675501,
          7688797,
          8900294,
          10190285,
          11457758,
          12939400,
          15283050,
          18252190,
          21210254,
          24739869,
          29170398
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Zambia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2672000,
          3016000,
          3421000,
          3900000,
          4506497,
          5216550,
          6100407,
          7272406,
          8381163,
          9417789,
          10595811,
          11746035
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Africa<br>country=Zimbabwe<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Africa",
         "line": {
          "color": "#00cc96"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Africa",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3080907,
          3646340,
          4277736,
          4995432,
          5861135,
          6642107,
          7636524,
          9216418,
          10704340,
          11404948,
          11926563,
          12311143
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Argentina<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": true,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          17876956,
          19610538,
          21283783,
          22934225,
          24779799,
          26983828,
          29341374,
          31620918,
          33958947,
          36203463,
          38331121,
          40301927
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Bolivia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2883315,
          3211738,
          3593918,
          4040665,
          4565872,
          5079716,
          5642224,
          6156369,
          6893451,
          7693188,
          8445134,
          9119152
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Brazil<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          56602560,
          65551171,
          76039390,
          88049823,
          100840058,
          114313951,
          128962939,
          142938076,
          155975974,
          168546719,
          179914212,
          190010647
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Canada<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          14785584,
          17010154,
          18985849,
          20819767,
          22284500,
          23796400,
          25201900,
          26549700,
          28523502,
          30305843,
          31902268,
          33390141
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Chile<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          6377619,
          7048426,
          7961258,
          8858908,
          9717524,
          10599793,
          11487112,
          12463354,
          13572994,
          14599929,
          15497046,
          16284741
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Colombia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          12350771,
          14485993,
          17009885,
          19764027,
          22542890,
          25094412,
          27764644,
          30964245,
          34202721,
          37657830,
          41008227,
          44227550
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Costa Rica<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          926317,
          1112300,
          1345187,
          1588717,
          1834796,
          2108457,
          2424367,
          2799811,
          3173216,
          3518107,
          3834934,
          4133884
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Cuba<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          6007797,
          6640752,
          7254373,
          8139332,
          8831348,
          9537988,
          9789224,
          10239839,
          10723260,
          10983007,
          11226999,
          11416987
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Dominican Republic<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2491346,
          2923186,
          3453434,
          4049146,
          4671329,
          5302800,
          5968349,
          6655297,
          7351181,
          7992357,
          8650322,
          9319622
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Ecuador<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3548753,
          4058385,
          4681707,
          5432424,
          6298651,
          7278866,
          8365850,
          9545158,
          10748394,
          11911819,
          12921234,
          13755680
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=El Salvador<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2042865,
          2355805,
          2747687,
          3232927,
          3790903,
          4282586,
          4474873,
          4842194,
          5274649,
          5783439,
          6353681,
          6939688
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Guatemala<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3146381,
          3640876,
          4208858,
          4690773,
          5149581,
          5703430,
          6395630,
          7326406,
          8486949,
          9803875,
          11178650,
          12572928
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Haiti<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          3201488,
          3507701,
          3880130,
          4318137,
          4698301,
          4908554,
          5198399,
          5756203,
          6326682,
          6913545,
          7607651,
          8502814
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Honduras<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1517453,
          1770390,
          2090162,
          2500689,
          2965146,
          3055235,
          3669448,
          4372203,
          5077347,
          5867957,
          6677328,
          7483763
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Jamaica<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1426095,
          1535090,
          1665128,
          1861096,
          1997616,
          2156814,
          2298309,
          2326606,
          2378618,
          2531311,
          2664659,
          2780132
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Mexico<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          30144317,
          35015548,
          41121485,
          47995559,
          55984294,
          63759976,
          71640904,
          80122492,
          88111030,
          95895146,
          102479927,
          108700891
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Nicaragua<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1165790,
          1358828,
          1590597,
          1865490,
          2182908,
          2554598,
          2979423,
          3344353,
          4017939,
          4609572,
          5146848,
          5675356
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Panama<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          940080,
          1063506,
          1215725,
          1405486,
          1616384,
          1839782,
          2036305,
          2253639,
          2484997,
          2734531,
          2990875,
          3242173
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Paraguay<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1555876,
          1770902,
          2009813,
          2287985,
          2614104,
          2984494,
          3366439,
          3886512,
          4483945,
          5154123,
          5884491,
          6667147
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Peru<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8025700,
          9146100,
          10516500,
          12132200,
          13954700,
          15990099,
          18125129,
          20195924,
          22430449,
          24748122,
          26769436,
          28674757
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Puerto Rico<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2227000,
          2260000,
          2448046,
          2648961,
          2847132,
          3080828,
          3279001,
          3444468,
          3585176,
          3759430,
          3859606,
          3942491
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Trinidad and Tobago<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          662850,
          764900,
          887498,
          960155,
          975199,
          1039009,
          1116479,
          1191336,
          1183669,
          1138101,
          1101832,
          1056608
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=United States<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          157553000,
          171984000,
          186538000,
          198712000,
          209896000,
          220239000,
          232187835,
          242803533,
          256894189,
          272911760,
          287675526,
          301139947
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Uruguay<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          2252965,
          2424959,
          2598466,
          2748579,
          2829526,
          2873520,
          2953997,
          3045153,
          3149262,
          3262838,
          3363085,
          3447496
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Americas<br>country=Venezuela<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Americas",
         "line": {
          "color": "#ab63fa"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Americas",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          5439568,
          6702668,
          8143375,
          9709552,
          11515649,
          13503563,
          15620766,
          17910182,
          20265563,
          22374398,
          24287670,
          26084662
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Oceania<br>country=Australia<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Oceania",
         "line": {
          "color": "#FFA15A"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Oceania",
         "orientation": "v",
         "showlegend": true,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          8691212,
          9712569,
          10794968,
          11872264,
          13177000,
          14074100,
          15184200,
          16257249,
          17481977,
          18565243,
          19546792,
          20434176
         ],
         "yaxis": "y"
        },
        {
         "fillpattern": {
          "shape": ""
         },
         "hovertemplate": "continent=Oceania<br>country=New Zealand<br>year=%{x}<br>pop=%{y}<extra></extra>",
         "legendgroup": "Oceania",
         "line": {
          "color": "#FFA15A"
         },
         "marker": {
          "symbol": "circle"
         },
         "mode": "lines",
         "name": "Oceania",
         "orientation": "v",
         "showlegend": false,
         "stackgroup": "1",
         "type": "scatter",
         "x": [
          1952,
          1957,
          1962,
          1967,
          1972,
          1977,
          1982,
          1987,
          1992,
          1997,
          2002,
          2007
         ],
         "xaxis": "x",
         "y": [
          1994794,
          2229407,
          2488550,
          2728150,
          2929100,
          3164900,
          3210650,
          3317166,
          3437674,
          3676187,
          3908037,
          4115771
         ],
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "title": {
          "text": "continent"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "year"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "pop"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# area 图\n",
    "px.area(gapminder,  \n",
    "        x=\"year\",\n",
    "        y=\"pop\",\n",
    "        color=\"continent\",\n",
    "        line_group=\"country\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "fill": "tozerox",
         "name": "tozerox",
         "type": "scatter",
         "x": [
          1,
          2,
          3,
          4
         ],
         "y": [
          1,
          2,
          3,
          5
         ]
        },
        {
         "fill": "tozeroy",
         "name": "tozeroy",
         "type": "scatter",
         "x": [
          1,
          2,
          3,
          4
         ],
         "y": [
          1,
          2,
          3,
          5
         ]
        }
       ],
       "layout": {
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = go.Figure()\n",
    "\n",
    "# 通过散点图的不同填充方式来实现的\n",
    "\n",
    "fig.add_trace(go.Scatter(x=[1, 2, 3, 4], \n",
    "                         y=[1, 2, 3, 5], \n",
    "                         fill='tozerox', # 填充方式：向着x轴填充\n",
    "                         name=\"tozerox\" # 轨迹名称\n",
    "                        )) \n",
    "\n",
    "# fig.add_trace(go.Scatter(x=[1, 2, 3, 4], \n",
    "#                          y=[1, 2, 3, 5], \n",
    "#                          fill='tonexty', # 填充方式：向着x轴填充\n",
    "#                          name=\"tonexty\" # 轨迹名称\n",
    "#                         )) \n",
    "\n",
    "\n",
    "fig.add_trace(go.Scatter(x=[1, 2, 3, 4], \n",
    "                         y=[1, 2, 3, 5], \n",
    "                         fill='tozeroy', # 填充方式：向着x轴填充\n",
    "                         name=\"tozeroy\" # 轨迹名称\n",
    "                        )) \n",
    "\n",
    "\n",
    "# fig.add_trace(go.Scatter(x=[1, 2, 3, 4], \n",
    "#                          y=[3, 5, 1, 7], \n",
    "#                          fill='tonexty',\n",
    "#                          name=\"tonexty\"\n",
    "#                         ))\n",
    "\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 饼图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>total_bill</th>\n",
       "      <th>tip</th>\n",
       "      <th>sex</th>\n",
       "      <th>smoker</th>\n",
       "      <th>day</th>\n",
       "      <th>time</th>\n",
       "      <th>size</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>16.99</td>\n",
       "      <td>1.01</td>\n",
       "      <td>Female</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>10.34</td>\n",
       "      <td>1.66</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>21.01</td>\n",
       "      <td>3.50</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>23.68</td>\n",
       "      <td>3.31</td>\n",
       "      <td>Male</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>24.59</td>\n",
       "      <td>3.61</td>\n",
       "      <td>Female</td>\n",
       "      <td>No</td>\n",
       "      <td>Sun</td>\n",
       "      <td>Dinner</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   total_bill   tip     sex smoker  day    time  size\n",
       "0       16.99  1.01  Female     No  Sun  Dinner     2\n",
       "1       10.34  1.66    Male     No  Sun  Dinner     3\n",
       "2       21.01  3.50    Male     No  Sun  Dinner     3\n",
       "3       23.68  3.31    Male     No  Sun  Dinner     2\n",
       "4       24.59  3.61  Female     No  Sun  Dinner     4"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tips.head()  # 查看前5行数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>day</th>\n",
       "      <th>total_bill</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Fri</td>\n",
       "      <td>325.88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Sat</td>\n",
       "      <td>1778.40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Sun</td>\n",
       "      <td>1627.16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Thur</td>\n",
       "      <td>1096.33</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    day  total_bill\n",
       "0   Fri      325.88\n",
       "1   Sat     1778.40\n",
       "2   Sun     1627.16\n",
       "3  Thur     1096.33"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 根据day分组，统计total_bill字段的和\n",
    "\n",
    "total_bill_byday = tips.groupby(by=\"day\")[\"total_bill\"].sum().reset_index()\n",
    "total_bill_byday"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "domain": {
          "x": [
           0,
           1
          ],
          "y": [
           0,
           1
          ]
         },
         "hovertemplate": "day=%{label}<br>total_bill=%{value}<extra></extra>",
         "labels": [
          "Fri",
          "Sat",
          "Sun",
          "Thur"
         ],
         "legendgroup": "",
         "name": "",
         "showlegend": true,
         "type": "pie",
         "values": [
          325.88,
          1778.4,
          1627.16,
          1096.33
         ]
        }
       ],
       "layout": {
        "legend": {
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.pie(total_bill_byday, # 绘图数据\n",
    "       names=\"day\",  # 每个组的名字\n",
    "       values=\"total_bill\"  # 组的取值\n",
    "      )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "labels": [
          "Fri",
          "Sat",
          "Sun",
          "Thur"
         ],
         "type": "pie",
         "values": [
          325.88,
          1778.4,
          1627.16,
          1096.33
         ]
        }
       ],
       "layout": {
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = go.Figure(data=go.Pie(\n",
    "    labels=total_bill_byday[\"day\"].tolist(),\n",
    "    values=total_bill_byday[\"total_bill\"].tolist()\n",
    "))\n",
    "\n",
    "fig.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 旭日图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "branchvalues": "total",
         "customdata": [
          [
           "AFG",
           42.129
          ],
          [
           "ALB",
           75.65100000000002
          ],
          [
           "DZA",
           70.99399999999999
          ],
          [
           "AGO",
           41.003
          ],
          [
           "ARG",
           74.34
          ],
          [
           "AUS",
           80.37
          ],
          [
           "AUT",
           78.98
          ],
          [
           "BHR",
           74.795
          ],
          [
           "BGD",
           62.01300000000001
          ],
          [
           "BEL",
           78.32
          ],
          [
           "BEN",
           54.40600000000001
          ],
          [
           "BOL",
           63.883
          ],
          [
           "BIH",
           74.09
          ],
          [
           "BWA",
           46.634
          ],
          [
           "BRA",
           71.006
          ],
          [
           "BGR",
           72.14
          ],
          [
           "BFA",
           50.65
          ],
          [
           "BDI",
           47.36
          ],
          [
           "KHM",
           56.752
          ],
          [
           "CMR",
           49.856
          ],
          [
           "CAN",
           79.77
          ],
          [
           "CAF",
           43.308
          ],
          [
           "TCD",
           50.525
          ],
          [
           "CHL",
           77.86
          ],
          [
           "CHN",
           72.028
          ],
          [
           "COL",
           71.682
          ],
          [
           "COM",
           62.974
          ],
          [
           "COD",
           44.966
          ],
          [
           "COG",
           52.97
          ],
          [
           "CRI",
           78.123
          ],
          [
           "CIV",
           46.832
          ],
          [
           "HRV",
           74.876
          ],
          [
           "CUB",
           77.158
          ],
          [
           "CZE",
           75.51
          ],
          [
           "DNK",
           77.18
          ],
          [
           "DJI",
           53.37300000000001
          ],
          [
           "DOM",
           70.847
          ],
          [
           "ECU",
           74.173
          ],
          [
           "EGY",
           69.806
          ],
          [
           "SLV",
           70.734
          ],
          [
           "GNQ",
           49.348
          ],
          [
           "ERI",
           55.24
          ],
          [
           "ETH",
           50.725
          ],
          [
           "FIN",
           78.37
          ],
          [
           "FRA",
           79.59
          ],
          [
           "GAB",
           56.760999999999996
          ],
          [
           "GMB",
           58.04099999999999
          ],
          [
           "DEU",
           78.67
          ],
          [
           "GHA",
           58.453
          ],
          [
           "GRC",
           78.256
          ],
          [
           "GTM",
           68.97800000000001
          ],
          [
           "GIN",
           53.676
          ],
          [
           "GNB",
           45.504
          ],
          [
           "HTI",
           58.137
          ],
          [
           "HND",
           68.565
          ],
          [
           "HKG",
           81.495
          ],
          [
           "HUN",
           72.59
          ],
          [
           "ISL",
           80.5
          ],
          [
           "IND",
           62.879
          ],
          [
           "IDN",
           68.58800000000001
          ],
          [
           "IRN",
           69.45100000000001
          ],
          [
           "IRQ",
           57.046000000000014
          ],
          [
           "IRL",
           77.783
          ],
          [
           "ISR",
           79.696
          ],
          [
           "ITA",
           80.23999999999998
          ],
          [
           "JAM",
           72.047
          ],
          [
           "JPN",
           82
          ],
          [
           "JOR",
           71.263
          ],
          [
           "KEN",
           50.992
          ],
          [
           "KOR",
           66.66199999999999
          ],
          [
           "KOR",
           77.045
          ],
          [
           "KWT",
           76.904
          ],
          [
           "LBN",
           71.028
          ],
          [
           "LSO",
           44.593
          ],
          [
           "LBR",
           43.753
          ],
          [
           "LBY",
           72.737
          ],
          [
           "MDG",
           57.286
          ],
          [
           "MWI",
           45.00899999999999
          ],
          [
           "MYS",
           73.044
          ],
          [
           "MLI",
           51.81800000000002
          ],
          [
           "MRT",
           62.247
          ],
          [
           "MUS",
           71.954
          ],
          [
           "MEX",
           74.902
          ],
          [
           "MNG",
           65.033
          ],
          [
           "MNE",
           73.98100000000002
          ],
          [
           "MAR",
           69.61500000000001
          ],
          [
           "MOZ",
           44.026
          ],
          [
           "MMR",
           59.907999999999994
          ],
          [
           "NAM",
           51.479
          ],
          [
           "NPL",
           61.339999999999996
          ],
          [
           "NLD",
           78.53
          ],
          [
           "NZL",
           79.11
          ],
          [
           "NIC",
           70.836
          ],
          [
           "NER",
           54.496
          ],
          [
           "NGA",
           46.608
          ],
          [
           "NOR",
           79.05
          ],
          [
           "OMN",
           74.193
          ],
          [
           "PAK",
           63.61
          ],
          [
           "PAN",
           74.712
          ],
          [
           "PRY",
           70.755
          ],
          [
           "PER",
           69.906
          ],
          [
           "PHL",
           70.303
          ],
          [
           "POL",
           74.67
          ],
          [
           "PRT",
           77.29
          ],
          [
           "PRI",
           77.77799999999999
          ],
          [
           "REU",
           75.744
          ],
          [
           "ROU",
           71.322
          ],
          [
           "RWA",
           43.413
          ],
          [
           "STP",
           64.337
          ],
          [
           "SAU",
           71.626
          ],
          [
           "SEN",
           61.6
          ],
          [
           "SRB",
           73.21300000000002
          ],
          [
           "SLE",
           41.012
          ],
          [
           "SGP",
           78.77
          ],
          [
           "SVK",
           73.8
          ],
          [
           "SVN",
           76.66
          ],
          [
           "SOM",
           45.936
          ],
          [
           "ZAF",
           53.365
          ],
          [
           "ESP",
           79.78
          ],
          [
           "LKA",
           70.815
          ],
          [
           "SDN",
           56.369
          ],
          [
           "SWZ",
           43.869
          ],
          [
           "SWE",
           80.04
          ],
          [
           "CHE",
           80.62
          ],
          [
           "SYR",
           73.053
          ],
          [
           "TWN",
           76.99
          ],
          [
           "TZA",
           49.651
          ],
          [
           "THA",
           68.564
          ],
          [
           "TGO",
           57.56100000000001
          ],
          [
           "TTO",
           68.976
          ],
          [
           "TUN",
           73.042
          ],
          [
           "TUR",
           70.845
          ],
          [
           "UGA",
           47.813
          ],
          [
           "GBR",
           78.471
          ],
          [
           "USA",
           77.31
          ],
          [
           "URY",
           75.307
          ],
          [
           "VEN",
           72.766
          ],
          [
           "VNM",
           73.017
          ],
          [
           "PSE",
           72.37
          ],
          [
           "YEM",
           60.30799999999999
          ],
          [
           "ZMB",
           39.19300000000001
          ],
          [
           "ZWE",
           39.989
          ],
          [
           "(?)",
           53.30314257576126
          ],
          [
           "(?)",
           74.24735797794376
          ],
          [
           "(?)",
           68.13731854047927
          ],
          [
           "(?)",
           77.02232007521468
          ],
          [
           "(?)",
           80.16005915498255
          ]
         ],
         "domain": {
          "x": [
           0,
           1
          ],
          "y": [
           0,
           1
          ]
         },
         "hovertemplate": "labels=%{label}<br>pop=%{value}<br>parent=%{parent}<br>id=%{id}<br>iso_alpha=%{customdata[0]}<br>lifeExp=%{color}<extra></extra>",
         "ids": [
          "Asia/Afghanistan",
          "Europe/Albania",
          "Africa/Algeria",
          "Africa/Angola",
          "Americas/Argentina",
          "Oceania/Australia",
          "Europe/Austria",
          "Asia/Bahrain",
          "Asia/Bangladesh",
          "Europe/Belgium",
          "Africa/Benin",
          "Americas/Bolivia",
          "Europe/Bosnia and Herzegovina",
          "Africa/Botswana",
          "Americas/Brazil",
          "Europe/Bulgaria",
          "Africa/Burkina Faso",
          "Africa/Burundi",
          "Asia/Cambodia",
          "Africa/Cameroon",
          "Americas/Canada",
          "Africa/Central African Republic",
          "Africa/Chad",
          "Americas/Chile",
          "Asia/China",
          "Americas/Colombia",
          "Africa/Comoros",
          "Africa/Congo, Dem. Rep.",
          "Africa/Congo, Rep.",
          "Americas/Costa Rica",
          "Africa/Cote d'Ivoire",
          "Europe/Croatia",
          "Americas/Cuba",
          "Europe/Czech Republic",
          "Europe/Denmark",
          "Africa/Djibouti",
          "Americas/Dominican Republic",
          "Americas/Ecuador",
          "Africa/Egypt",
          "Americas/El Salvador",
          "Africa/Equatorial Guinea",
          "Africa/Eritrea",
          "Africa/Ethiopia",
          "Europe/Finland",
          "Europe/France",
          "Africa/Gabon",
          "Africa/Gambia",
          "Europe/Germany",
          "Africa/Ghana",
          "Europe/Greece",
          "Americas/Guatemala",
          "Africa/Guinea",
          "Africa/Guinea-Bissau",
          "Americas/Haiti",
          "Americas/Honduras",
          "Asia/Hong Kong, China",
          "Europe/Hungary",
          "Europe/Iceland",
          "Asia/India",
          "Asia/Indonesia",
          "Asia/Iran",
          "Asia/Iraq",
          "Europe/Ireland",
          "Asia/Israel",
          "Europe/Italy",
          "Americas/Jamaica",
          "Asia/Japan",
          "Asia/Jordan",
          "Africa/Kenya",
          "Asia/Korea, Dem. Rep.",
          "Asia/Korea, Rep.",
          "Asia/Kuwait",
          "Asia/Lebanon",
          "Africa/Lesotho",
          "Africa/Liberia",
          "Africa/Libya",
          "Africa/Madagascar",
          "Africa/Malawi",
          "Asia/Malaysia",
          "Africa/Mali",
          "Africa/Mauritania",
          "Africa/Mauritius",
          "Americas/Mexico",
          "Asia/Mongolia",
          "Europe/Montenegro",
          "Africa/Morocco",
          "Africa/Mozambique",
          "Asia/Myanmar",
          "Africa/Namibia",
          "Asia/Nepal",
          "Europe/Netherlands",
          "Oceania/New Zealand",
          "Americas/Nicaragua",
          "Africa/Niger",
          "Africa/Nigeria",
          "Europe/Norway",
          "Asia/Oman",
          "Asia/Pakistan",
          "Americas/Panama",
          "Americas/Paraguay",
          "Americas/Peru",
          "Asia/Philippines",
          "Europe/Poland",
          "Europe/Portugal",
          "Americas/Puerto Rico",
          "Africa/Reunion",
          "Europe/Romania",
          "Africa/Rwanda",
          "Africa/Sao Tome and Principe",
          "Asia/Saudi Arabia",
          "Africa/Senegal",
          "Europe/Serbia",
          "Africa/Sierra Leone",
          "Asia/Singapore",
          "Europe/Slovak Republic",
          "Europe/Slovenia",
          "Africa/Somalia",
          "Africa/South Africa",
          "Europe/Spain",
          "Asia/Sri Lanka",
          "Africa/Sudan",
          "Africa/Swaziland",
          "Europe/Sweden",
          "Europe/Switzerland",
          "Asia/Syria",
          "Asia/Taiwan",
          "Africa/Tanzania",
          "Asia/Thailand",
          "Africa/Togo",
          "Americas/Trinidad and Tobago",
          "Africa/Tunisia",
          "Europe/Turkey",
          "Africa/Uganda",
          "Europe/United Kingdom",
          "Americas/United States",
          "Americas/Uruguay",
          "Americas/Venezuela",
          "Asia/Vietnam",
          "Asia/West Bank and Gaza",
          "Asia/Yemen, Rep.",
          "Africa/Zambia",
          "Africa/Zimbabwe",
          "Africa",
          "Americas",
          "Asia",
          "Europe",
          "Oceania"
         ],
         "labels": [
          "Afghanistan",
          "Albania",
          "Algeria",
          "Angola",
          "Argentina",
          "Australia",
          "Austria",
          "Bahrain",
          "Bangladesh",
          "Belgium",
          "Benin",
          "Bolivia",
          "Bosnia and Herzegovina",
          "Botswana",
          "Brazil",
          "Bulgaria",
          "Burkina Faso",
          "Burundi",
          "Cambodia",
          "Cameroon",
          "Canada",
          "Central African Republic",
          "Chad",
          "Chile",
          "China",
          "Colombia",
          "Comoros",
          "Congo, Dem. Rep.",
          "Congo, Rep.",
          "Costa Rica",
          "Cote d'Ivoire",
          "Croatia",
          "Cuba",
          "Czech Republic",
          "Denmark",
          "Djibouti",
          "Dominican Republic",
          "Ecuador",
          "Egypt",
          "El Salvador",
          "Equatorial Guinea",
          "Eritrea",
          "Ethiopia",
          "Finland",
          "France",
          "Gabon",
          "Gambia",
          "Germany",
          "Ghana",
          "Greece",
          "Guatemala",
          "Guinea",
          "Guinea-Bissau",
          "Haiti",
          "Honduras",
          "Hong Kong, China",
          "Hungary",
          "Iceland",
          "India",
          "Indonesia",
          "Iran",
          "Iraq",
          "Ireland",
          "Israel",
          "Italy",
          "Jamaica",
          "Japan",
          "Jordan",
          "Kenya",
          "Korea, Dem. Rep.",
          "Korea, Rep.",
          "Kuwait",
          "Lebanon",
          "Lesotho",
          "Liberia",
          "Libya",
          "Madagascar",
          "Malawi",
          "Malaysia",
          "Mali",
          "Mauritania",
          "Mauritius",
          "Mexico",
          "Mongolia",
          "Montenegro",
          "Morocco",
          "Mozambique",
          "Myanmar",
          "Namibia",
          "Nepal",
          "Netherlands",
          "New Zealand",
          "Nicaragua",
          "Niger",
          "Nigeria",
          "Norway",
          "Oman",
          "Pakistan",
          "Panama",
          "Paraguay",
          "Peru",
          "Philippines",
          "Poland",
          "Portugal",
          "Puerto Rico",
          "Reunion",
          "Romania",
          "Rwanda",
          "Sao Tome and Principe",
          "Saudi Arabia",
          "Senegal",
          "Serbia",
          "Sierra Leone",
          "Singapore",
          "Slovak Republic",
          "Slovenia",
          "Somalia",
          "South Africa",
          "Spain",
          "Sri Lanka",
          "Sudan",
          "Swaziland",
          "Sweden",
          "Switzerland",
          "Syria",
          "Taiwan",
          "Tanzania",
          "Thailand",
          "Togo",
          "Trinidad and Tobago",
          "Tunisia",
          "Turkey",
          "Uganda",
          "United Kingdom",
          "United States",
          "Uruguay",
          "Venezuela",
          "Vietnam",
          "West Bank and Gaza",
          "Yemen, Rep.",
          "Zambia",
          "Zimbabwe",
          "Africa",
          "Americas",
          "Asia",
          "Europe",
          "Oceania"
         ],
         "marker": {
          "coloraxis": "coloraxis",
          "colors": [
           42.129,
           75.65100000000002,
           70.99399999999999,
           41.003,
           74.34,
           80.37,
           78.98,
           74.795,
           62.01300000000001,
           78.32,
           54.40600000000001,
           63.883,
           74.09,
           46.634,
           71.006,
           72.14,
           50.65,
           47.36,
           56.752,
           49.856,
           79.77,
           43.308,
           50.525,
           77.86,
           72.028,
           71.682,
           62.974,
           44.966,
           52.97,
           78.123,
           46.832,
           74.876,
           77.158,
           75.51,
           77.18,
           53.37300000000001,
           70.847,
           74.173,
           69.806,
           70.734,
           49.348,
           55.24,
           50.725,
           78.37,
           79.59,
           56.760999999999996,
           58.04099999999999,
           78.67,
           58.453,
           78.256,
           68.97800000000001,
           53.676,
           45.504,
           58.137,
           68.565,
           81.495,
           72.59,
           80.5,
           62.879,
           68.58800000000001,
           69.45100000000001,
           57.046000000000014,
           77.783,
           79.696,
           80.23999999999998,
           72.047,
           82,
           71.263,
           50.992,
           66.66199999999999,
           77.045,
           76.904,
           71.028,
           44.593,
           43.753,
           72.737,
           57.286,
           45.00899999999999,
           73.044,
           51.81800000000002,
           62.247,
           71.954,
           74.902,
           65.033,
           73.98100000000002,
           69.61500000000001,
           44.026,
           59.907999999999994,
           51.479,
           61.339999999999996,
           78.53,
           79.11,
           70.836,
           54.496,
           46.608,
           79.05,
           74.193,
           63.61,
           74.712,
           70.755,
           69.906,
           70.303,
           74.67,
           77.29,
           77.77799999999999,
           75.744,
           71.322,
           43.413,
           64.337,
           71.626,
           61.6,
           73.21300000000002,
           41.012,
           78.77,
           73.8,
           76.66,
           45.936,
           53.365,
           79.78,
           70.815,
           56.369,
           43.869,
           80.04,
           80.62,
           73.053,
           76.99,
           49.651,
           68.564,
           57.56100000000001,
           68.976,
           73.042,
           70.845,
           47.813,
           78.471,
           77.31,
           75.307,
           72.766,
           73.017,
           72.37,
           60.30799999999999,
           39.19300000000001,
           39.989,
           53.30314257576126,
           74.24735797794376,
           68.13731854047927,
           77.02232007521468,
           80.16005915498255
          ]
         },
         "name": "",
         "parents": [
          "Asia",
          "Europe",
          "Africa",
          "Africa",
          "Americas",
          "Oceania",
          "Europe",
          "Asia",
          "Asia",
          "Europe",
          "Africa",
          "Americas",
          "Europe",
          "Africa",
          "Americas",
          "Europe",
          "Africa",
          "Africa",
          "Asia",
          "Africa",
          "Americas",
          "Africa",
          "Africa",
          "Americas",
          "Asia",
          "Americas",
          "Africa",
          "Africa",
          "Africa",
          "Americas",
          "Africa",
          "Europe",
          "Americas",
          "Europe",
          "Europe",
          "Africa",
          "Americas",
          "Americas",
          "Africa",
          "Americas",
          "Africa",
          "Africa",
          "Africa",
          "Europe",
          "Europe",
          "Africa",
          "Africa",
          "Europe",
          "Africa",
          "Europe",
          "Americas",
          "Africa",
          "Africa",
          "Americas",
          "Americas",
          "Asia",
          "Europe",
          "Europe",
          "Asia",
          "Asia",
          "Asia",
          "Asia",
          "Europe",
          "Asia",
          "Europe",
          "Americas",
          "Asia",
          "Asia",
          "Africa",
          "Asia",
          "Asia",
          "Asia",
          "Asia",
          "Africa",
          "Africa",
          "Africa",
          "Africa",
          "Africa",
          "Asia",
          "Africa",
          "Africa",
          "Africa",
          "Americas",
          "Asia",
          "Europe",
          "Africa",
          "Africa",
          "Asia",
          "Africa",
          "Asia",
          "Europe",
          "Oceania",
          "Americas",
          "Africa",
          "Africa",
          "Europe",
          "Asia",
          "Asia",
          "Americas",
          "Americas",
          "Americas",
          "Asia",
          "Europe",
          "Europe",
          "Americas",
          "Africa",
          "Europe",
          "Africa",
          "Africa",
          "Asia",
          "Africa",
          "Europe",
          "Africa",
          "Asia",
          "Europe",
          "Europe",
          "Africa",
          "Africa",
          "Europe",
          "Asia",
          "Africa",
          "Africa",
          "Europe",
          "Europe",
          "Asia",
          "Asia",
          "Africa",
          "Asia",
          "Africa",
          "Americas",
          "Africa",
          "Europe",
          "Africa",
          "Europe",
          "Americas",
          "Americas",
          "Americas",
          "Asia",
          "Asia",
          "Asia",
          "Africa",
          "Africa",
          "",
          "",
          "",
          "",
          ""
         ],
         "type": "sunburst",
         "values": [
          25268405,
          3508512,
          31287142,
          10866106,
          38331121,
          19546792,
          8148312,
          656397,
          135656790,
          10311970,
          7026113,
          8445134,
          4165416,
          1630347,
          179914212,
          7661799,
          12251209,
          7021078,
          12926707,
          15929988,
          31902268,
          4048013,
          8835739,
          15497046,
          1280400000,
          41008227,
          614382,
          55379852,
          3328795,
          3834934,
          16252726,
          4481020,
          11226999,
          10256295,
          5374693,
          447416,
          8650322,
          12921234,
          73312559,
          6353681,
          495627,
          4414865,
          67946797,
          5193039,
          59925035,
          1299304,
          1457766,
          82350671,
          20550751,
          10603863,
          11178650,
          8807818,
          1332459,
          7607651,
          6677328,
          6762476,
          10083313,
          288030,
          1034172547,
          211060000,
          66907826,
          24001816,
          3879155,
          6029529,
          57926999,
          2664659,
          127065841,
          5307470,
          31386842,
          22215365,
          47969150,
          2111561,
          3677780,
          2046772,
          2814651,
          5368585,
          16473477,
          11824495,
          22662365,
          10580176,
          2828858,
          1200206,
          102479927,
          2674234,
          720230,
          31167783,
          18473780,
          45598081,
          1972153,
          25873917,
          16122830,
          3908037,
          5146848,
          11140655,
          119901274,
          4535591,
          2713462,
          153403524,
          2990875,
          5884491,
          26769436,
          82995088,
          38625976,
          10433867,
          3859606,
          743981,
          22404337,
          7852401,
          170372,
          24501530,
          10870037,
          10111559,
          5359092,
          4197776,
          5410052,
          2011497,
          7753310,
          44433622,
          40152517,
          19576783,
          37090298,
          1130269,
          8954175,
          7361757,
          17155814,
          22454239,
          34593779,
          62806748,
          4977378,
          1101832,
          9770575,
          67308928,
          24739869,
          59912431,
          287675526,
          3363085,
          24287670,
          80908147,
          3389578,
          18701257,
          10595811,
          11926563,
          833723916,
          849772762,
          3601802203,
          578223869,
          23454829
         ]
        }
       ],
       "layout": {
        "coloraxis": {
         "colorbar": {
          "title": {
           "text": "lifeExp"
          }
         },
         "colorscale": [
          [
           0,
           "#0d0887"
          ],
          [
           0.1111111111111111,
           "#46039f"
          ],
          [
           0.2222222222222222,
           "#7201a8"
          ],
          [
           0.3333333333333333,
           "#9c179e"
          ],
          [
           0.4444444444444444,
           "#bd3786"
          ],
          [
           0.5555555555555556,
           "#d8576b"
          ],
          [
           0.6666666666666666,
           "#ed7953"
          ],
          [
           0.7777777777777778,
           "#fb9f3a"
          ],
          [
           0.8888888888888888,
           "#fdca26"
          ],
          [
           1,
           "#f0f921"
          ]
         ]
        },
        "legend": {
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 选取2002年数据\n",
    "gapminder_2002 = gapminder[gapminder[\"year\"] == 2002]\n",
    "\n",
    "px.sunburst(gapminder_2002,   # 绘图数据\n",
    "            path=['continent', 'country'],  # 指定路径：从洲到国家\n",
    "            values='pop', # 数据大小：人口数\n",
    "            color='lifeExp',  # 颜色\n",
    "            hover_data=['iso_alpha'] # 显示数据\n",
    "           )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 漏斗图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "number=%{x}<br>stage=%{y}<extra></extra>",
         "legendgroup": "1000",
         "marker": {
          "color": "#636efa"
         },
         "name": "1000",
         "orientation": "h",
         "showlegend": true,
         "type": "funnel",
         "x": [
          1000
         ],
         "xaxis": "x",
         "y": [
          "UV"
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "number=%{x}<br>stage=%{y}<extra></extra>",
         "legendgroup": "800",
         "marker": {
          "color": "#EF553B"
         },
         "name": "800",
         "orientation": "h",
         "showlegend": true,
         "type": "funnel",
         "x": [
          800
         ],
         "xaxis": "x",
         "y": [
          "搜索"
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "number=%{x}<br>stage=%{y}<extra></extra>",
         "legendgroup": "400",
         "marker": {
          "color": "#00cc96"
         },
         "name": "400",
         "orientation": "h",
         "showlegend": true,
         "type": "funnel",
         "x": [
          400
         ],
         "xaxis": "x",
         "y": [
          "搜藏"
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "number=%{x}<br>stage=%{y}<extra></extra>",
         "legendgroup": "200",
         "marker": {
          "color": "#ab63fa"
         },
         "name": "200",
         "orientation": "h",
         "showlegend": true,
         "type": "funnel",
         "x": [
          200
         ],
         "xaxis": "x",
         "y": [
          "加购"
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "number=%{x}<br>stage=%{y}<extra></extra>",
         "legendgroup": "100",
         "marker": {
          "color": "#FFA15A"
         },
         "name": "100",
         "orientation": "h",
         "showlegend": true,
         "type": "funnel",
         "x": [
          100
         ],
         "xaxis": "x",
         "y": [
          "下单"
         ],
         "yaxis": "y"
        },
        {
         "hovertemplate": "number=%{x}<br>stage=%{y}<extra></extra>",
         "legendgroup": "30",
         "marker": {
          "color": "#19d3f3"
         },
         "name": "30",
         "orientation": "h",
         "showlegend": true,
         "type": "funnel",
         "x": [
          30
         ],
         "xaxis": "x",
         "y": [
          "付款"
         ],
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "title": {
          "text": "number"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "categoryarray": [
          1000,
          800,
          400,
          200,
          100,
          30
         ],
         "categoryorder": "array",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "number"
         }
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "stage"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "data = dict(   # 创建原始数据\n",
    "    number = [1000, 800, 400, 200, 100, 30],\n",
    "    stage = [\"UV\", \"搜索\", \"搜藏\", \"加购\", \"下单\", \"付款\"]\n",
    ")\n",
    "\n",
    "# 传入数据和数轴\n",
    "px.funnel(data, \n",
    "          x=\"number\", \n",
    "          y=\"stage\",\n",
    "          color=\"number\"  # 颜色设置\n",
    "         )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 联合分布图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "species=setosa<br>sepal_width=%{x}<br>sepal_length=%{y}<extra></extra>",
         "legendgroup": "setosa",
         "marker": {
          "color": "#636efa",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "setosa",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          3.5,
          3,
          3.2,
          3.1,
          3.6,
          3.9,
          3.4,
          3.4,
          2.9,
          3.1,
          3.7,
          3.4,
          3,
          3,
          4,
          4.4,
          3.9,
          3.5,
          3.8,
          3.8,
          3.4,
          3.7,
          3.6,
          3.3,
          3.4,
          3,
          3.4,
          3.5,
          3.4,
          3.2,
          3.1,
          3.4,
          4.1,
          4.2,
          3.1,
          3.2,
          3.5,
          3.1,
          3,
          3.4,
          3.5,
          2.3,
          3.2,
          3.5,
          3.8,
          3,
          3.8,
          3.2,
          3.7,
          3.3
         ],
         "xaxis": "x",
         "y": [
          5.1,
          4.9,
          4.7,
          4.6,
          5,
          5.4,
          4.6,
          5,
          4.4,
          4.9,
          5.4,
          4.8,
          4.8,
          4.3,
          5.8,
          5.7,
          5.4,
          5.1,
          5.7,
          5.1,
          5.4,
          5.1,
          4.6,
          5.1,
          4.8,
          5,
          5,
          5.2,
          5.2,
          4.7,
          4.8,
          5.4,
          5.2,
          5.5,
          4.9,
          5,
          5.5,
          4.9,
          4.4,
          5.1,
          5,
          4.5,
          4.4,
          5,
          5.1,
          4.8,
          5.1,
          4.6,
          5.3,
          5
         ],
         "yaxis": "y"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "hovertemplate": "species=setosa<br>sepal_width=%{x}<br>count=%{y}<extra></extra>",
         "legendgroup": "setosa",
         "marker": {
          "color": "#636efa"
         },
         "name": "setosa",
         "offsetgroup": "setosa",
         "opacity": 0.5,
         "showlegend": false,
         "type": "histogram",
         "x": [
          3.5,
          3,
          3.2,
          3.1,
          3.6,
          3.9,
          3.4,
          3.4,
          2.9,
          3.1,
          3.7,
          3.4,
          3,
          3,
          4,
          4.4,
          3.9,
          3.5,
          3.8,
          3.8,
          3.4,
          3.7,
          3.6,
          3.3,
          3.4,
          3,
          3.4,
          3.5,
          3.4,
          3.2,
          3.1,
          3.4,
          4.1,
          4.2,
          3.1,
          3.2,
          3.5,
          3.1,
          3,
          3.4,
          3.5,
          2.3,
          3.2,
          3.5,
          3.8,
          3,
          3.8,
          3.2,
          3.7,
          3.3
         ],
         "xaxis": "x3",
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "boxpoints": "all",
         "fillcolor": "rgba(255,255,255,0)",
         "hoveron": "points",
         "hovertemplate": "species=setosa<br>sepal_length=%{y}<extra></extra>",
         "jitter": 0,
         "legendgroup": "setosa",
         "line": {
          "color": "rgba(255,255,255,0)"
         },
         "marker": {
          "color": "#636efa",
          "symbol": "line-ew-open"
         },
         "name": "setosa",
         "offsetgroup": "setosa",
         "showlegend": false,
         "type": "box",
         "xaxis": "x2",
         "y": [
          5.1,
          4.9,
          4.7,
          4.6,
          5,
          5.4,
          4.6,
          5,
          4.4,
          4.9,
          5.4,
          4.8,
          4.8,
          4.3,
          5.8,
          5.7,
          5.4,
          5.1,
          5.7,
          5.1,
          5.4,
          5.1,
          4.6,
          5.1,
          4.8,
          5,
          5,
          5.2,
          5.2,
          4.7,
          4.8,
          5.4,
          5.2,
          5.5,
          4.9,
          5,
          5.5,
          4.9,
          4.4,
          5.1,
          5,
          4.5,
          4.4,
          5,
          5.1,
          4.8,
          5.1,
          4.6,
          5.3,
          5
         ],
         "yaxis": "y2"
        },
        {
         "hovertemplate": "species=versicolor<br>sepal_width=%{x}<br>sepal_length=%{y}<extra></extra>",
         "legendgroup": "versicolor",
         "marker": {
          "color": "#EF553B",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "versicolor",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          3.2,
          3.2,
          3.1,
          2.3,
          2.8,
          2.8,
          3.3,
          2.4,
          2.9,
          2.7,
          2,
          3,
          2.2,
          2.9,
          2.9,
          3.1,
          3,
          2.7,
          2.2,
          2.5,
          3.2,
          2.8,
          2.5,
          2.8,
          2.9,
          3,
          2.8,
          3,
          2.9,
          2.6,
          2.4,
          2.4,
          2.7,
          2.7,
          3,
          3.4,
          3.1,
          2.3,
          3,
          2.5,
          2.6,
          3,
          2.6,
          2.3,
          2.7,
          3,
          2.9,
          2.9,
          2.5,
          2.8
         ],
         "xaxis": "x",
         "y": [
          7,
          6.4,
          6.9,
          5.5,
          6.5,
          5.7,
          6.3,
          4.9,
          6.6,
          5.2,
          5,
          5.9,
          6,
          6.1,
          5.6,
          6.7,
          5.6,
          5.8,
          6.2,
          5.6,
          5.9,
          6.1,
          6.3,
          6.1,
          6.4,
          6.6,
          6.8,
          6.7,
          6,
          5.7,
          5.5,
          5.5,
          5.8,
          6,
          5.4,
          6,
          6.7,
          6.3,
          5.6,
          5.5,
          5.5,
          6.1,
          5.8,
          5,
          5.6,
          5.7,
          5.7,
          6.2,
          5.1,
          5.7
         ],
         "yaxis": "y"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "hovertemplate": "species=versicolor<br>sepal_width=%{x}<br>count=%{y}<extra></extra>",
         "legendgroup": "versicolor",
         "marker": {
          "color": "#EF553B"
         },
         "name": "versicolor",
         "offsetgroup": "versicolor",
         "opacity": 0.5,
         "showlegend": false,
         "type": "histogram",
         "x": [
          3.2,
          3.2,
          3.1,
          2.3,
          2.8,
          2.8,
          3.3,
          2.4,
          2.9,
          2.7,
          2,
          3,
          2.2,
          2.9,
          2.9,
          3.1,
          3,
          2.7,
          2.2,
          2.5,
          3.2,
          2.8,
          2.5,
          2.8,
          2.9,
          3,
          2.8,
          3,
          2.9,
          2.6,
          2.4,
          2.4,
          2.7,
          2.7,
          3,
          3.4,
          3.1,
          2.3,
          3,
          2.5,
          2.6,
          3,
          2.6,
          2.3,
          2.7,
          3,
          2.9,
          2.9,
          2.5,
          2.8
         ],
         "xaxis": "x3",
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "boxpoints": "all",
         "fillcolor": "rgba(255,255,255,0)",
         "hoveron": "points",
         "hovertemplate": "species=versicolor<br>sepal_length=%{y}<extra></extra>",
         "jitter": 0,
         "legendgroup": "versicolor",
         "line": {
          "color": "rgba(255,255,255,0)"
         },
         "marker": {
          "color": "#EF553B",
          "symbol": "line-ew-open"
         },
         "name": "versicolor",
         "offsetgroup": "versicolor",
         "showlegend": false,
         "type": "box",
         "xaxis": "x2",
         "y": [
          7,
          6.4,
          6.9,
          5.5,
          6.5,
          5.7,
          6.3,
          4.9,
          6.6,
          5.2,
          5,
          5.9,
          6,
          6.1,
          5.6,
          6.7,
          5.6,
          5.8,
          6.2,
          5.6,
          5.9,
          6.1,
          6.3,
          6.1,
          6.4,
          6.6,
          6.8,
          6.7,
          6,
          5.7,
          5.5,
          5.5,
          5.8,
          6,
          5.4,
          6,
          6.7,
          6.3,
          5.6,
          5.5,
          5.5,
          6.1,
          5.8,
          5,
          5.6,
          5.7,
          5.7,
          6.2,
          5.1,
          5.7
         ],
         "yaxis": "y2"
        },
        {
         "hovertemplate": "species=virginica<br>sepal_width=%{x}<br>sepal_length=%{y}<extra></extra>",
         "legendgroup": "virginica",
         "marker": {
          "color": "#00cc96",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "virginica",
         "orientation": "v",
         "showlegend": true,
         "type": "scatter",
         "x": [
          3.3,
          2.7,
          3,
          2.9,
          3,
          3,
          2.5,
          2.9,
          2.5,
          3.6,
          3.2,
          2.7,
          3,
          2.5,
          2.8,
          3.2,
          3,
          3.8,
          2.6,
          2.2,
          3.2,
          2.8,
          2.8,
          2.7,
          3.3,
          3.2,
          2.8,
          3,
          2.8,
          3,
          2.8,
          3.8,
          2.8,
          2.8,
          2.6,
          3,
          3.4,
          3.1,
          3,
          3.1,
          3.1,
          3.1,
          2.7,
          3.2,
          3.3,
          3,
          2.5,
          3,
          3.4,
          3
         ],
         "xaxis": "x",
         "y": [
          6.3,
          5.8,
          7.1,
          6.3,
          6.5,
          7.6,
          4.9,
          7.3,
          6.7,
          7.2,
          6.5,
          6.4,
          6.8,
          5.7,
          5.8,
          6.4,
          6.5,
          7.7,
          7.7,
          6,
          6.9,
          5.6,
          7.7,
          6.3,
          6.7,
          7.2,
          6.2,
          6.1,
          6.4,
          7.2,
          7.4,
          7.9,
          6.4,
          6.3,
          6.1,
          7.7,
          6.3,
          6.4,
          6,
          6.9,
          6.7,
          6.9,
          5.8,
          6.8,
          6.7,
          6.7,
          6.3,
          6.5,
          6.2,
          5.9
         ],
         "yaxis": "y"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "hovertemplate": "species=virginica<br>sepal_width=%{x}<br>count=%{y}<extra></extra>",
         "legendgroup": "virginica",
         "marker": {
          "color": "#00cc96"
         },
         "name": "virginica",
         "offsetgroup": "virginica",
         "opacity": 0.5,
         "showlegend": false,
         "type": "histogram",
         "x": [
          3.3,
          2.7,
          3,
          2.9,
          3,
          3,
          2.5,
          2.9,
          2.5,
          3.6,
          3.2,
          2.7,
          3,
          2.5,
          2.8,
          3.2,
          3,
          3.8,
          2.6,
          2.2,
          3.2,
          2.8,
          2.8,
          2.7,
          3.3,
          3.2,
          2.8,
          3,
          2.8,
          3,
          2.8,
          3.8,
          2.8,
          2.8,
          2.6,
          3,
          3.4,
          3.1,
          3,
          3.1,
          3.1,
          3.1,
          2.7,
          3.2,
          3.3,
          3,
          2.5,
          3,
          3.4,
          3
         ],
         "xaxis": "x3",
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "boxpoints": "all",
         "fillcolor": "rgba(255,255,255,0)",
         "hoveron": "points",
         "hovertemplate": "species=virginica<br>sepal_length=%{y}<extra></extra>",
         "jitter": 0,
         "legendgroup": "virginica",
         "line": {
          "color": "rgba(255,255,255,0)"
         },
         "marker": {
          "color": "#00cc96",
          "symbol": "line-ew-open"
         },
         "name": "virginica",
         "offsetgroup": "virginica",
         "showlegend": false,
         "type": "box",
         "xaxis": "x2",
         "y": [
          6.3,
          5.8,
          7.1,
          6.3,
          6.5,
          7.6,
          4.9,
          7.3,
          6.7,
          7.2,
          6.5,
          6.4,
          6.8,
          5.7,
          5.8,
          6.4,
          6.5,
          7.7,
          7.7,
          6,
          6.9,
          5.6,
          7.7,
          6.3,
          6.7,
          7.2,
          6.2,
          6.1,
          6.4,
          7.2,
          7.4,
          7.9,
          6.4,
          6.3,
          6.1,
          7.7,
          6.3,
          6.4,
          6,
          6.9,
          6.7,
          6.9,
          5.8,
          6.8,
          6.7,
          6.7,
          6.3,
          6.5,
          6.2,
          5.9
         ],
         "yaxis": "y2"
        }
       ],
       "layout": {
        "barmode": "overlay",
        "legend": {
         "title": {
          "text": "species"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          0.7363
         ],
         "title": {
          "text": "sepal_width"
         }
        },
        "xaxis2": {
         "anchor": "y2",
         "domain": [
          0.7413,
          1
         ],
         "matches": "x2",
         "showgrid": false,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "xaxis3": {
         "anchor": "y3",
         "domain": [
          0,
          0.7363
         ],
         "matches": "x",
         "showgrid": true,
         "showticklabels": false
        },
        "xaxis4": {
         "anchor": "y4",
         "domain": [
          0.7413,
          1
         ],
         "matches": "x2",
         "showgrid": false,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          0.7326
         ],
         "title": {
          "text": "sepal_length"
         }
        },
        "yaxis2": {
         "anchor": "x2",
         "domain": [
          0,
          0.7326
         ],
         "matches": "y",
         "showgrid": true,
         "showticklabels": false
        },
        "yaxis3": {
         "anchor": "x3",
         "domain": [
          0.7426,
          1
         ],
         "matches": "y3",
         "showgrid": true,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "yaxis4": {
         "anchor": "x4",
         "domain": [
          0.7426,
          1
         ],
         "matches": "y3",
         "showgrid": true,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.scatter(\n",
    "    iris,\n",
    "    x=\"sepal_width\",\n",
    "    y=\"sepal_length\",\n",
    "    color=\"species\",\n",
    "    marginal_x=\"histogram\",\n",
    "    marginal_y=\"rug\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 小提琴图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "alignmentgroup": "True",
         "box": {
          "visible": false
         },
         "hovertemplate": "species=setosa<br>sepal_width=%{y}<extra></extra>",
         "legendgroup": "setosa",
         "marker": {
          "color": "#636efa"
         },
         "name": "setosa",
         "offsetgroup": "setosa",
         "orientation": "v",
         "scalegroup": "True",
         "showlegend": true,
         "type": "violin",
         "x0": " ",
         "xaxis": "x",
         "y": [
          3.5,
          3,
          3.2,
          3.1,
          3.6,
          3.9,
          3.4,
          3.4,
          2.9,
          3.1,
          3.7,
          3.4,
          3,
          3,
          4,
          4.4,
          3.9,
          3.5,
          3.8,
          3.8,
          3.4,
          3.7,
          3.6,
          3.3,
          3.4,
          3,
          3.4,
          3.5,
          3.4,
          3.2,
          3.1,
          3.4,
          4.1,
          4.2,
          3.1,
          3.2,
          3.5,
          3.1,
          3,
          3.4,
          3.5,
          2.3,
          3.2,
          3.5,
          3.8,
          3,
          3.8,
          3.2,
          3.7,
          3.3
         ],
         "y0": " ",
         "yaxis": "y"
        },
        {
         "alignmentgroup": "True",
         "box": {
          "visible": false
         },
         "hovertemplate": "species=versicolor<br>sepal_width=%{y}<extra></extra>",
         "legendgroup": "versicolor",
         "marker": {
          "color": "#EF553B"
         },
         "name": "versicolor",
         "offsetgroup": "versicolor",
         "orientation": "v",
         "scalegroup": "True",
         "showlegend": true,
         "type": "violin",
         "x0": " ",
         "xaxis": "x",
         "y": [
          3.2,
          3.2,
          3.1,
          2.3,
          2.8,
          2.8,
          3.3,
          2.4,
          2.9,
          2.7,
          2,
          3,
          2.2,
          2.9,
          2.9,
          3.1,
          3,
          2.7,
          2.2,
          2.5,
          3.2,
          2.8,
          2.5,
          2.8,
          2.9,
          3,
          2.8,
          3,
          2.9,
          2.6,
          2.4,
          2.4,
          2.7,
          2.7,
          3,
          3.4,
          3.1,
          2.3,
          3,
          2.5,
          2.6,
          3,
          2.6,
          2.3,
          2.7,
          3,
          2.9,
          2.9,
          2.5,
          2.8
         ],
         "y0": " ",
         "yaxis": "y"
        },
        {
         "alignmentgroup": "True",
         "box": {
          "visible": false
         },
         "hovertemplate": "species=virginica<br>sepal_width=%{y}<extra></extra>",
         "legendgroup": "virginica",
         "marker": {
          "color": "#00cc96"
         },
         "name": "virginica",
         "offsetgroup": "virginica",
         "orientation": "v",
         "scalegroup": "True",
         "showlegend": true,
         "type": "violin",
         "x0": " ",
         "xaxis": "x",
         "y": [
          3.3,
          2.7,
          3,
          2.9,
          3,
          3,
          2.5,
          2.9,
          2.5,
          3.6,
          3.2,
          2.7,
          3,
          2.5,
          2.8,
          3.2,
          3,
          3.8,
          2.6,
          2.2,
          3.2,
          2.8,
          2.8,
          2.7,
          3.3,
          3.2,
          2.8,
          3,
          2.8,
          3,
          2.8,
          3.8,
          2.8,
          2.8,
          2.6,
          3,
          3.4,
          3.1,
          3,
          3.1,
          3.1,
          3.1,
          2.7,
          3.2,
          3.3,
          3,
          2.5,
          3,
          3.4,
          3
         ],
         "y0": " ",
         "yaxis": "y"
        }
       ],
       "layout": {
        "legend": {
         "title": {
          "text": "species"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "violinmode": "group",
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          1
         ]
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          1
         ],
         "title": {
          "text": "sepal_width"
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.violin(iris,\n",
    "           y=\"sepal_width\",\n",
    "           color=\"species\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 散点矩阵图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "      <th>species_id</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     sepal_length  sepal_width  petal_length  petal_width    species  \\\n",
       "0             5.1          3.5           1.4          0.2     setosa   \n",
       "1             4.9          3.0           1.4          0.2     setosa   \n",
       "2             4.7          3.2           1.3          0.2     setosa   \n",
       "3             4.6          3.1           1.5          0.2     setosa   \n",
       "4             5.0          3.6           1.4          0.2     setosa   \n",
       "..            ...          ...           ...          ...        ...   \n",
       "145           6.7          3.0           5.2          2.3  virginica   \n",
       "146           6.3          2.5           5.0          1.9  virginica   \n",
       "147           6.5          3.0           5.2          2.0  virginica   \n",
       "148           6.2          3.4           5.4          2.3  virginica   \n",
       "149           5.9          3.0           5.1          1.8  virginica   \n",
       "\n",
       "     species_id  \n",
       "0             1  \n",
       "1             1  \n",
       "2             1  \n",
       "3             1  \n",
       "4             1  \n",
       "..          ...  \n",
       "145           3  \n",
       "146           3  \n",
       "147           3  \n",
       "148           3  \n",
       "149           3  \n",
       "\n",
       "[150 rows x 6 columns]"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "dimensions": [
          {
           "axis": {
            "matches": true
           },
           "label": "sepal_width",
           "values": [
            3.5,
            3,
            3.2,
            3.1,
            3.6,
            3.9,
            3.4,
            3.4,
            2.9,
            3.1,
            3.7,
            3.4,
            3,
            3,
            4,
            4.4,
            3.9,
            3.5,
            3.8,
            3.8,
            3.4,
            3.7,
            3.6,
            3.3,
            3.4,
            3,
            3.4,
            3.5,
            3.4,
            3.2,
            3.1,
            3.4,
            4.1,
            4.2,
            3.1,
            3.2,
            3.5,
            3.1,
            3,
            3.4,
            3.5,
            2.3,
            3.2,
            3.5,
            3.8,
            3,
            3.8,
            3.2,
            3.7,
            3.3
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "sepal_length",
           "values": [
            5.1,
            4.9,
            4.7,
            4.6,
            5,
            5.4,
            4.6,
            5,
            4.4,
            4.9,
            5.4,
            4.8,
            4.8,
            4.3,
            5.8,
            5.7,
            5.4,
            5.1,
            5.7,
            5.1,
            5.4,
            5.1,
            4.6,
            5.1,
            4.8,
            5,
            5,
            5.2,
            5.2,
            4.7,
            4.8,
            5.4,
            5.2,
            5.5,
            4.9,
            5,
            5.5,
            4.9,
            4.4,
            5.1,
            5,
            4.5,
            4.4,
            5,
            5.1,
            4.8,
            5.1,
            4.6,
            5.3,
            5
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "petal_width",
           "values": [
            0.2,
            0.2,
            0.2,
            0.2,
            0.2,
            0.4,
            0.3,
            0.2,
            0.2,
            0.1,
            0.2,
            0.2,
            0.1,
            0.1,
            0.2,
            0.4,
            0.4,
            0.3,
            0.3,
            0.3,
            0.2,
            0.4,
            0.2,
            0.5,
            0.2,
            0.2,
            0.4,
            0.2,
            0.2,
            0.2,
            0.2,
            0.4,
            0.1,
            0.2,
            0.1,
            0.2,
            0.2,
            0.1,
            0.2,
            0.2,
            0.3,
            0.3,
            0.2,
            0.6,
            0.4,
            0.3,
            0.2,
            0.2,
            0.2,
            0.2
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "petal_length",
           "values": [
            1.4,
            1.4,
            1.3,
            1.5,
            1.4,
            1.7,
            1.4,
            1.5,
            1.4,
            1.5,
            1.5,
            1.6,
            1.4,
            1.1,
            1.2,
            1.5,
            1.3,
            1.4,
            1.7,
            1.5,
            1.7,
            1.5,
            1,
            1.7,
            1.9,
            1.6,
            1.6,
            1.5,
            1.4,
            1.6,
            1.6,
            1.5,
            1.5,
            1.4,
            1.5,
            1.2,
            1.3,
            1.5,
            1.3,
            1.5,
            1.3,
            1.3,
            1.3,
            1.6,
            1.9,
            1.4,
            1.6,
            1.4,
            1.5,
            1.4
           ]
          }
         ],
         "hovertemplate": "species=setosa<br>%{xaxis.title.text}=%{x}<br>%{yaxis.title.text}=%{y}<extra></extra>",
         "legendgroup": "setosa",
         "marker": {
          "color": "#636efa",
          "symbol": "circle"
         },
         "name": "setosa",
         "showlegend": true,
         "type": "splom"
        },
        {
         "dimensions": [
          {
           "axis": {
            "matches": true
           },
           "label": "sepal_width",
           "values": [
            3.2,
            3.2,
            3.1,
            2.3,
            2.8,
            2.8,
            3.3,
            2.4,
            2.9,
            2.7,
            2,
            3,
            2.2,
            2.9,
            2.9,
            3.1,
            3,
            2.7,
            2.2,
            2.5,
            3.2,
            2.8,
            2.5,
            2.8,
            2.9,
            3,
            2.8,
            3,
            2.9,
            2.6,
            2.4,
            2.4,
            2.7,
            2.7,
            3,
            3.4,
            3.1,
            2.3,
            3,
            2.5,
            2.6,
            3,
            2.6,
            2.3,
            2.7,
            3,
            2.9,
            2.9,
            2.5,
            2.8
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "sepal_length",
           "values": [
            7,
            6.4,
            6.9,
            5.5,
            6.5,
            5.7,
            6.3,
            4.9,
            6.6,
            5.2,
            5,
            5.9,
            6,
            6.1,
            5.6,
            6.7,
            5.6,
            5.8,
            6.2,
            5.6,
            5.9,
            6.1,
            6.3,
            6.1,
            6.4,
            6.6,
            6.8,
            6.7,
            6,
            5.7,
            5.5,
            5.5,
            5.8,
            6,
            5.4,
            6,
            6.7,
            6.3,
            5.6,
            5.5,
            5.5,
            6.1,
            5.8,
            5,
            5.6,
            5.7,
            5.7,
            6.2,
            5.1,
            5.7
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "petal_width",
           "values": [
            1.4,
            1.5,
            1.5,
            1.3,
            1.5,
            1.3,
            1.6,
            1,
            1.3,
            1.4,
            1,
            1.5,
            1,
            1.4,
            1.3,
            1.4,
            1.5,
            1,
            1.5,
            1.1,
            1.8,
            1.3,
            1.5,
            1.2,
            1.3,
            1.4,
            1.4,
            1.7,
            1.5,
            1,
            1.1,
            1,
            1.2,
            1.6,
            1.5,
            1.6,
            1.5,
            1.3,
            1.3,
            1.3,
            1.2,
            1.4,
            1.2,
            1,
            1.3,
            1.2,
            1.3,
            1.3,
            1.1,
            1.3
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "petal_length",
           "values": [
            4.7,
            4.5,
            4.9,
            4,
            4.6,
            4.5,
            4.7,
            3.3,
            4.6,
            3.9,
            3.5,
            4.2,
            4,
            4.7,
            3.6,
            4.4,
            4.5,
            4.1,
            4.5,
            3.9,
            4.8,
            4,
            4.9,
            4.7,
            4.3,
            4.4,
            4.8,
            5,
            4.5,
            3.5,
            3.8,
            3.7,
            3.9,
            5.1,
            4.5,
            4.5,
            4.7,
            4.4,
            4.1,
            4,
            4.4,
            4.6,
            4,
            3.3,
            4.2,
            4.2,
            4.2,
            4.3,
            3,
            4.1
           ]
          }
         ],
         "hovertemplate": "species=versicolor<br>%{xaxis.title.text}=%{x}<br>%{yaxis.title.text}=%{y}<extra></extra>",
         "legendgroup": "versicolor",
         "marker": {
          "color": "#EF553B",
          "symbol": "circle"
         },
         "name": "versicolor",
         "showlegend": true,
         "type": "splom"
        },
        {
         "dimensions": [
          {
           "axis": {
            "matches": true
           },
           "label": "sepal_width",
           "values": [
            3.3,
            2.7,
            3,
            2.9,
            3,
            3,
            2.5,
            2.9,
            2.5,
            3.6,
            3.2,
            2.7,
            3,
            2.5,
            2.8,
            3.2,
            3,
            3.8,
            2.6,
            2.2,
            3.2,
            2.8,
            2.8,
            2.7,
            3.3,
            3.2,
            2.8,
            3,
            2.8,
            3,
            2.8,
            3.8,
            2.8,
            2.8,
            2.6,
            3,
            3.4,
            3.1,
            3,
            3.1,
            3.1,
            3.1,
            2.7,
            3.2,
            3.3,
            3,
            2.5,
            3,
            3.4,
            3
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "sepal_length",
           "values": [
            6.3,
            5.8,
            7.1,
            6.3,
            6.5,
            7.6,
            4.9,
            7.3,
            6.7,
            7.2,
            6.5,
            6.4,
            6.8,
            5.7,
            5.8,
            6.4,
            6.5,
            7.7,
            7.7,
            6,
            6.9,
            5.6,
            7.7,
            6.3,
            6.7,
            7.2,
            6.2,
            6.1,
            6.4,
            7.2,
            7.4,
            7.9,
            6.4,
            6.3,
            6.1,
            7.7,
            6.3,
            6.4,
            6,
            6.9,
            6.7,
            6.9,
            5.8,
            6.8,
            6.7,
            6.7,
            6.3,
            6.5,
            6.2,
            5.9
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "petal_width",
           "values": [
            2.5,
            1.9,
            2.1,
            1.8,
            2.2,
            2.1,
            1.7,
            1.8,
            1.8,
            2.5,
            2,
            1.9,
            2.1,
            2,
            2.4,
            2.3,
            1.8,
            2.2,
            2.3,
            1.5,
            2.3,
            2,
            2,
            1.8,
            2.1,
            1.8,
            1.8,
            1.8,
            2.1,
            1.6,
            1.9,
            2,
            2.2,
            1.5,
            1.4,
            2.3,
            2.4,
            1.8,
            1.8,
            2.1,
            2.4,
            2.3,
            1.9,
            2.3,
            2.5,
            2.3,
            1.9,
            2,
            2.3,
            1.8
           ]
          },
          {
           "axis": {
            "matches": true
           },
           "label": "petal_length",
           "values": [
            6,
            5.1,
            5.9,
            5.6,
            5.8,
            6.6,
            4.5,
            6.3,
            5.8,
            6.1,
            5.1,
            5.3,
            5.5,
            5,
            5.1,
            5.3,
            5.5,
            6.7,
            6.9,
            5,
            5.7,
            4.9,
            6.7,
            4.9,
            5.7,
            6,
            4.8,
            4.9,
            5.6,
            5.8,
            6.1,
            6.4,
            5.6,
            5.1,
            5.6,
            6.1,
            5.6,
            5.5,
            4.8,
            5.4,
            5.6,
            5.1,
            5.1,
            5.9,
            5.7,
            5.2,
            5,
            5.2,
            5.4,
            5.1
           ]
          }
         ],
         "hovertemplate": "species=virginica<br>%{xaxis.title.text}=%{x}<br>%{yaxis.title.text}=%{y}<extra></extra>",
         "legendgroup": "virginica",
         "marker": {
          "color": "#00cc96",
          "symbol": "circle"
         },
         "name": "virginica",
         "showlegend": true,
         "type": "splom"
        }
       ],
       "layout": {
        "dragmode": "select",
        "legend": {
         "title": {
          "text": "species"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.scatter_matrix(iris,\n",
    "                  dimensions=[\"sepal_width\",\"sepal_length\",\"petal_width\",\"petal_length\"],\n",
    "                  color=\"species\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 并行分类图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "dimensions": [
          {
           "label": "sex",
           "values": [
            "Female",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Female",
            "Male",
            "Female",
            "Male",
            "Female",
            "Male",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Female",
            "Female",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Female",
            "Female",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Female",
            "Male",
            "Male",
            "Female",
            "Female",
            "Male",
            "Female",
            "Female",
            "Female",
            "Male",
            "Female",
            "Male",
            "Male",
            "Female",
            "Female",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Female",
            "Female",
            "Female",
            "Female",
            "Female",
            "Female",
            "Female",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Female",
            "Female",
            "Female",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Female",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Female",
            "Female",
            "Female",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Female",
            "Female",
            "Female",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Female",
            "Male",
            "Female",
            "Male",
            "Female",
            "Female",
            "Male",
            "Male",
            "Female",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Male",
            "Female",
            "Male",
            "Female",
            "Male",
            "Male",
            "Female"
           ]
          },
          {
           "label": "smoker",
           "values": [
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "Yes",
            "No",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "No",
            "No",
            "Yes",
            "No",
            "Yes",
            "No",
            "No",
            "Yes",
            "Yes",
            "No",
            "No",
            "Yes",
            "No",
            "No",
            "No",
            "Yes",
            "No",
            "No",
            "Yes",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "Yes",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "Yes",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "No",
            "Yes",
            "No",
            "No",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "No",
            "Yes",
            "Yes",
            "Yes",
            "No",
            "No",
            "Yes",
            "No",
            "Yes",
            "Yes",
            "No",
            "No",
            "Yes",
            "Yes",
            "No",
            "No"
           ]
          },
          {
           "label": "day",
           "values": [
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Sun",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Thur",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Fri",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Sat",
            "Thur"
           ]
          },
          {
           "label": "time",
           "values": [
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Lunch",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner",
            "Dinner"
           ]
          },
          {
           "label": "size",
           "values": [
            2,
            3,
            3,
            2,
            4,
            4,
            2,
            4,
            2,
            2,
            2,
            4,
            2,
            4,
            2,
            2,
            3,
            3,
            3,
            3,
            2,
            2,
            2,
            4,
            2,
            4,
            2,
            2,
            2,
            2,
            2,
            4,
            2,
            4,
            2,
            3,
            3,
            3,
            3,
            3,
            3,
            2,
            2,
            2,
            4,
            2,
            2,
            4,
            3,
            2,
            2,
            2,
            4,
            2,
            4,
            2,
            4,
            2,
            2,
            4,
            2,
            2,
            2,
            4,
            3,
            3,
            2,
            1,
            2,
            2,
            2,
            3,
            2,
            2,
            2,
            2,
            2,
            4,
            2,
            2,
            2,
            2,
            1,
            2,
            2,
            4,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            4,
            2,
            2,
            2,
            2,
            2,
            2,
            3,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            1,
            3,
            2,
            3,
            2,
            4,
            2,
            2,
            4,
            2,
            2,
            2,
            2,
            2,
            6,
            2,
            2,
            2,
            3,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            6,
            5,
            6,
            2,
            2,
            3,
            2,
            2,
            2,
            2,
            2,
            3,
            4,
            4,
            5,
            6,
            4,
            2,
            4,
            4,
            2,
            3,
            2,
            2,
            3,
            2,
            4,
            2,
            2,
            3,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            4,
            2,
            3,
            4,
            2,
            5,
            3,
            5,
            3,
            3,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            4,
            2,
            2,
            3,
            2,
            2,
            2,
            4,
            3,
            3,
            4,
            2,
            2,
            3,
            4,
            4,
            2,
            3,
            2,
            5,
            2,
            2,
            4,
            2,
            2,
            1,
            3,
            2,
            2,
            2,
            4,
            2,
            2,
            4,
            3,
            2,
            2,
            2,
            2,
            2,
            2,
            3,
            3,
            2,
            2,
            2,
            2
           ]
          }
         ],
         "domain": {
          "x": [
           0,
           1
          ],
          "y": [
           0,
           1
          ]
         },
         "line": {
          "color": [
           2,
           3,
           3,
           2,
           4,
           4,
           2,
           4,
           2,
           2,
           2,
           4,
           2,
           4,
           2,
           2,
           3,
           3,
           3,
           3,
           2,
           2,
           2,
           4,
           2,
           4,
           2,
           2,
           2,
           2,
           2,
           4,
           2,
           4,
           2,
           3,
           3,
           3,
           3,
           3,
           3,
           2,
           2,
           2,
           4,
           2,
           2,
           4,
           3,
           2,
           2,
           2,
           4,
           2,
           4,
           2,
           4,
           2,
           2,
           4,
           2,
           2,
           2,
           4,
           3,
           3,
           2,
           1,
           2,
           2,
           2,
           3,
           2,
           2,
           2,
           2,
           2,
           4,
           2,
           2,
           2,
           2,
           1,
           2,
           2,
           4,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           4,
           2,
           2,
           2,
           2,
           2,
           2,
           3,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           1,
           3,
           2,
           3,
           2,
           4,
           2,
           2,
           4,
           2,
           2,
           2,
           2,
           2,
           6,
           2,
           2,
           2,
           3,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           6,
           5,
           6,
           2,
           2,
           3,
           2,
           2,
           2,
           2,
           2,
           3,
           4,
           4,
           5,
           6,
           4,
           2,
           4,
           4,
           2,
           3,
           2,
           2,
           3,
           2,
           4,
           2,
           2,
           3,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           4,
           2,
           3,
           4,
           2,
           5,
           3,
           5,
           3,
           3,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           4,
           2,
           2,
           3,
           2,
           2,
           2,
           4,
           3,
           3,
           4,
           2,
           2,
           3,
           4,
           4,
           2,
           3,
           2,
           5,
           2,
           2,
           4,
           2,
           2,
           1,
           3,
           2,
           2,
           2,
           4,
           2,
           2,
           4,
           3,
           2,
           2,
           2,
           2,
           2,
           2,
           3,
           3,
           2,
           2,
           2,
           2
          ],
          "coloraxis": "coloraxis"
         },
         "name": "",
         "type": "parcats"
        }
       ],
       "layout": {
        "coloraxis": {
         "colorbar": {
          "title": {
           "text": "size"
          }
         },
         "colorscale": [
          [
           0,
           "#000004"
          ],
          [
           0.1111111111111111,
           "#1b0c41"
          ],
          [
           0.2222222222222222,
           "#4a0c6b"
          ],
          [
           0.3333333333333333,
           "#781c6d"
          ],
          [
           0.4444444444444444,
           "#a52c60"
          ],
          [
           0.5555555555555556,
           "#cf4446"
          ],
          [
           0.6666666666666666,
           "#ed6925"
          ],
          [
           0.7777777777777778,
           "#fb9b06"
          ],
          [
           0.8888888888888888,
           "#f7d13d"
          ],
          [
           1,
           "#fcffa4"
          ]
         ]
        },
        "legend": {
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.parallel_categories(\n",
    "    tips,  # 传入数据\n",
    "    color=\"size\",  # 颜色取值\n",
    "    color_continuous_scale=px.colors.sequential.Inferno # 颜色变化趋势\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 平行坐标图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "dimensions": [
          {
           "label": "Sepal Length",
           "values": [
            5.1,
            4.9,
            4.7,
            4.6,
            5,
            5.4,
            4.6,
            5,
            4.4,
            4.9,
            5.4,
            4.8,
            4.8,
            4.3,
            5.8,
            5.7,
            5.4,
            5.1,
            5.7,
            5.1,
            5.4,
            5.1,
            4.6,
            5.1,
            4.8,
            5,
            5,
            5.2,
            5.2,
            4.7,
            4.8,
            5.4,
            5.2,
            5.5,
            4.9,
            5,
            5.5,
            4.9,
            4.4,
            5.1,
            5,
            4.5,
            4.4,
            5,
            5.1,
            4.8,
            5.1,
            4.6,
            5.3,
            5,
            7,
            6.4,
            6.9,
            5.5,
            6.5,
            5.7,
            6.3,
            4.9,
            6.6,
            5.2,
            5,
            5.9,
            6,
            6.1,
            5.6,
            6.7,
            5.6,
            5.8,
            6.2,
            5.6,
            5.9,
            6.1,
            6.3,
            6.1,
            6.4,
            6.6,
            6.8,
            6.7,
            6,
            5.7,
            5.5,
            5.5,
            5.8,
            6,
            5.4,
            6,
            6.7,
            6.3,
            5.6,
            5.5,
            5.5,
            6.1,
            5.8,
            5,
            5.6,
            5.7,
            5.7,
            6.2,
            5.1,
            5.7,
            6.3,
            5.8,
            7.1,
            6.3,
            6.5,
            7.6,
            4.9,
            7.3,
            6.7,
            7.2,
            6.5,
            6.4,
            6.8,
            5.7,
            5.8,
            6.4,
            6.5,
            7.7,
            7.7,
            6,
            6.9,
            5.6,
            7.7,
            6.3,
            6.7,
            7.2,
            6.2,
            6.1,
            6.4,
            7.2,
            7.4,
            7.9,
            6.4,
            6.3,
            6.1,
            7.7,
            6.3,
            6.4,
            6,
            6.9,
            6.7,
            6.9,
            5.8,
            6.8,
            6.7,
            6.7,
            6.3,
            6.5,
            6.2,
            5.9
           ]
          },
          {
           "label": "Sepal Width",
           "values": [
            3.5,
            3,
            3.2,
            3.1,
            3.6,
            3.9,
            3.4,
            3.4,
            2.9,
            3.1,
            3.7,
            3.4,
            3,
            3,
            4,
            4.4,
            3.9,
            3.5,
            3.8,
            3.8,
            3.4,
            3.7,
            3.6,
            3.3,
            3.4,
            3,
            3.4,
            3.5,
            3.4,
            3.2,
            3.1,
            3.4,
            4.1,
            4.2,
            3.1,
            3.2,
            3.5,
            3.1,
            3,
            3.4,
            3.5,
            2.3,
            3.2,
            3.5,
            3.8,
            3,
            3.8,
            3.2,
            3.7,
            3.3,
            3.2,
            3.2,
            3.1,
            2.3,
            2.8,
            2.8,
            3.3,
            2.4,
            2.9,
            2.7,
            2,
            3,
            2.2,
            2.9,
            2.9,
            3.1,
            3,
            2.7,
            2.2,
            2.5,
            3.2,
            2.8,
            2.5,
            2.8,
            2.9,
            3,
            2.8,
            3,
            2.9,
            2.6,
            2.4,
            2.4,
            2.7,
            2.7,
            3,
            3.4,
            3.1,
            2.3,
            3,
            2.5,
            2.6,
            3,
            2.6,
            2.3,
            2.7,
            3,
            2.9,
            2.9,
            2.5,
            2.8,
            3.3,
            2.7,
            3,
            2.9,
            3,
            3,
            2.5,
            2.9,
            2.5,
            3.6,
            3.2,
            2.7,
            3,
            2.5,
            2.8,
            3.2,
            3,
            3.8,
            2.6,
            2.2,
            3.2,
            2.8,
            2.8,
            2.7,
            3.3,
            3.2,
            2.8,
            3,
            2.8,
            3,
            2.8,
            3.8,
            2.8,
            2.8,
            2.6,
            3,
            3.4,
            3.1,
            3,
            3.1,
            3.1,
            3.1,
            2.7,
            3.2,
            3.3,
            3,
            2.5,
            3,
            3.4,
            3
           ]
          },
          {
           "label": "Petal Length",
           "values": [
            1.4,
            1.4,
            1.3,
            1.5,
            1.4,
            1.7,
            1.4,
            1.5,
            1.4,
            1.5,
            1.5,
            1.6,
            1.4,
            1.1,
            1.2,
            1.5,
            1.3,
            1.4,
            1.7,
            1.5,
            1.7,
            1.5,
            1,
            1.7,
            1.9,
            1.6,
            1.6,
            1.5,
            1.4,
            1.6,
            1.6,
            1.5,
            1.5,
            1.4,
            1.5,
            1.2,
            1.3,
            1.5,
            1.3,
            1.5,
            1.3,
            1.3,
            1.3,
            1.6,
            1.9,
            1.4,
            1.6,
            1.4,
            1.5,
            1.4,
            4.7,
            4.5,
            4.9,
            4,
            4.6,
            4.5,
            4.7,
            3.3,
            4.6,
            3.9,
            3.5,
            4.2,
            4,
            4.7,
            3.6,
            4.4,
            4.5,
            4.1,
            4.5,
            3.9,
            4.8,
            4,
            4.9,
            4.7,
            4.3,
            4.4,
            4.8,
            5,
            4.5,
            3.5,
            3.8,
            3.7,
            3.9,
            5.1,
            4.5,
            4.5,
            4.7,
            4.4,
            4.1,
            4,
            4.4,
            4.6,
            4,
            3.3,
            4.2,
            4.2,
            4.2,
            4.3,
            3,
            4.1,
            6,
            5.1,
            5.9,
            5.6,
            5.8,
            6.6,
            4.5,
            6.3,
            5.8,
            6.1,
            5.1,
            5.3,
            5.5,
            5,
            5.1,
            5.3,
            5.5,
            6.7,
            6.9,
            5,
            5.7,
            4.9,
            6.7,
            4.9,
            5.7,
            6,
            4.8,
            4.9,
            5.6,
            5.8,
            6.1,
            6.4,
            5.6,
            5.1,
            5.6,
            6.1,
            5.6,
            5.5,
            4.8,
            5.4,
            5.6,
            5.1,
            5.1,
            5.9,
            5.7,
            5.2,
            5,
            5.2,
            5.4,
            5.1
           ]
          },
          {
           "label": "Petal Width",
           "values": [
            0.2,
            0.2,
            0.2,
            0.2,
            0.2,
            0.4,
            0.3,
            0.2,
            0.2,
            0.1,
            0.2,
            0.2,
            0.1,
            0.1,
            0.2,
            0.4,
            0.4,
            0.3,
            0.3,
            0.3,
            0.2,
            0.4,
            0.2,
            0.5,
            0.2,
            0.2,
            0.4,
            0.2,
            0.2,
            0.2,
            0.2,
            0.4,
            0.1,
            0.2,
            0.1,
            0.2,
            0.2,
            0.1,
            0.2,
            0.2,
            0.3,
            0.3,
            0.2,
            0.6,
            0.4,
            0.3,
            0.2,
            0.2,
            0.2,
            0.2,
            1.4,
            1.5,
            1.5,
            1.3,
            1.5,
            1.3,
            1.6,
            1,
            1.3,
            1.4,
            1,
            1.5,
            1,
            1.4,
            1.3,
            1.4,
            1.5,
            1,
            1.5,
            1.1,
            1.8,
            1.3,
            1.5,
            1.2,
            1.3,
            1.4,
            1.4,
            1.7,
            1.5,
            1,
            1.1,
            1,
            1.2,
            1.6,
            1.5,
            1.6,
            1.5,
            1.3,
            1.3,
            1.3,
            1.2,
            1.4,
            1.2,
            1,
            1.3,
            1.2,
            1.3,
            1.3,
            1.1,
            1.3,
            2.5,
            1.9,
            2.1,
            1.8,
            2.2,
            2.1,
            1.7,
            1.8,
            1.8,
            2.5,
            2,
            1.9,
            2.1,
            2,
            2.4,
            2.3,
            1.8,
            2.2,
            2.3,
            1.5,
            2.3,
            2,
            2,
            1.8,
            2.1,
            1.8,
            1.8,
            1.8,
            2.1,
            1.6,
            1.9,
            2,
            2.2,
            1.5,
            1.4,
            2.3,
            2.4,
            1.8,
            1.8,
            2.1,
            2.4,
            2.3,
            1.9,
            2.3,
            2.5,
            2.3,
            1.9,
            2,
            2.3,
            1.8
           ]
          },
          {
           "label": "Species",
           "values": [
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3
           ]
          }
         ],
         "domain": {
          "x": [
           0,
           1
          ],
          "y": [
           0,
           1
          ]
         },
         "line": {
          "color": [
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           1,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           2,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3,
           3
          ],
          "coloraxis": "coloraxis"
         },
         "name": "",
         "type": "parcoords"
        }
       ],
       "layout": {
        "coloraxis": {
         "cmid": 2,
         "colorbar": {
          "title": {
           "text": "Species"
          }
         },
         "colorscale": [
          [
           0,
           "rgb(0, 147, 146)"
          ],
          [
           0.16666666666666666,
           "rgb(114, 170, 161)"
          ],
          [
           0.3333333333333333,
           "rgb(177, 199, 179)"
          ],
          [
           0.5,
           "rgb(241, 234, 200)"
          ],
          [
           0.6666666666666666,
           "rgb(229, 185, 173)"
          ],
          [
           0.8333333333333334,
           "rgb(217, 137, 148)"
          ],
          [
           1,
           "rgb(208, 88, 126)"
          ]
         ]
        },
        "legend": {
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.parallel_coordinates(iris,\n",
    "                        color=\"species_id\",\n",
    "                        labels={\"species_id\":\"Species\",\n",
    "                               \"sepal_width\":\"Sepal Width\",\n",
    "                               \"sepal_length\":\"Sepal Length\",\n",
    "                               \"petal_length\":\"Petal Length\",\n",
    "                               \"petal_width\":\"Petal Width\"},\n",
    "                       color_continuous_scale=px.colors.diverging.Tealrose,\n",
    "                       color_continuous_midpoint=2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 密度等值线图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "contours": {
          "coloring": "none"
         },
         "hovertemplate": "species=setosa<br>sepal_width=%{x}<br>sepal_length=%{y}<br>count=%{z}<extra></extra>",
         "legendgroup": "setosa",
         "line": {
          "color": "#636efa"
         },
         "name": "setosa",
         "showlegend": true,
         "type": "histogram2dcontour",
         "x": [
          3.5,
          3,
          3.2,
          3.1,
          3.6,
          3.9,
          3.4,
          3.4,
          2.9,
          3.1,
          3.7,
          3.4,
          3,
          3,
          4,
          4.4,
          3.9,
          3.5,
          3.8,
          3.8,
          3.4,
          3.7,
          3.6,
          3.3,
          3.4,
          3,
          3.4,
          3.5,
          3.4,
          3.2,
          3.1,
          3.4,
          4.1,
          4.2,
          3.1,
          3.2,
          3.5,
          3.1,
          3,
          3.4,
          3.5,
          2.3,
          3.2,
          3.5,
          3.8,
          3,
          3.8,
          3.2,
          3.7,
          3.3
         ],
         "xaxis": "x",
         "xbingroup": "x",
         "y": [
          5.1,
          4.9,
          4.7,
          4.6,
          5,
          5.4,
          4.6,
          5,
          4.4,
          4.9,
          5.4,
          4.8,
          4.8,
          4.3,
          5.8,
          5.7,
          5.4,
          5.1,
          5.7,
          5.1,
          5.4,
          5.1,
          4.6,
          5.1,
          4.8,
          5,
          5,
          5.2,
          5.2,
          4.7,
          4.8,
          5.4,
          5.2,
          5.5,
          4.9,
          5,
          5.5,
          4.9,
          4.4,
          5.1,
          5,
          4.5,
          4.4,
          5,
          5.1,
          4.8,
          5.1,
          4.6,
          5.3,
          5
         ],
         "yaxis": "y",
         "ybingroup": "y"
        },
        {
         "alignmentgroup": "True",
         "boxpoints": "all",
         "fillcolor": "rgba(255,255,255,0)",
         "hoveron": "points",
         "hovertemplate": "species=setosa<br>sepal_width=%{x}<extra></extra>",
         "jitter": 0,
         "legendgroup": "setosa",
         "line": {
          "color": "rgba(255,255,255,0)"
         },
         "marker": {
          "color": "#636efa",
          "symbol": "line-ns-open"
         },
         "name": "setosa",
         "offsetgroup": "setosa",
         "showlegend": false,
         "type": "box",
         "x": [
          3.5,
          3,
          3.2,
          3.1,
          3.6,
          3.9,
          3.4,
          3.4,
          2.9,
          3.1,
          3.7,
          3.4,
          3,
          3,
          4,
          4.4,
          3.9,
          3.5,
          3.8,
          3.8,
          3.4,
          3.7,
          3.6,
          3.3,
          3.4,
          3,
          3.4,
          3.5,
          3.4,
          3.2,
          3.1,
          3.4,
          4.1,
          4.2,
          3.1,
          3.2,
          3.5,
          3.1,
          3,
          3.4,
          3.5,
          2.3,
          3.2,
          3.5,
          3.8,
          3,
          3.8,
          3.2,
          3.7,
          3.3
         ],
         "xaxis": "x3",
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "y",
         "hovertemplate": "species=setosa<br>sepal_length=%{y}<br>count=%{x}<extra></extra>",
         "legendgroup": "setosa",
         "marker": {
          "color": "#636efa"
         },
         "name": "setosa",
         "offsetgroup": "setosa",
         "opacity": 0.5,
         "showlegend": false,
         "type": "histogram",
         "xaxis": "x2",
         "y": [
          5.1,
          4.9,
          4.7,
          4.6,
          5,
          5.4,
          4.6,
          5,
          4.4,
          4.9,
          5.4,
          4.8,
          4.8,
          4.3,
          5.8,
          5.7,
          5.4,
          5.1,
          5.7,
          5.1,
          5.4,
          5.1,
          4.6,
          5.1,
          4.8,
          5,
          5,
          5.2,
          5.2,
          4.7,
          4.8,
          5.4,
          5.2,
          5.5,
          4.9,
          5,
          5.5,
          4.9,
          4.4,
          5.1,
          5,
          4.5,
          4.4,
          5,
          5.1,
          4.8,
          5.1,
          4.6,
          5.3,
          5
         ],
         "yaxis": "y2"
        },
        {
         "contours": {
          "coloring": "none"
         },
         "hovertemplate": "species=versicolor<br>sepal_width=%{x}<br>sepal_length=%{y}<br>count=%{z}<extra></extra>",
         "legendgroup": "versicolor",
         "line": {
          "color": "#EF553B"
         },
         "name": "versicolor",
         "showlegend": true,
         "type": "histogram2dcontour",
         "x": [
          3.2,
          3.2,
          3.1,
          2.3,
          2.8,
          2.8,
          3.3,
          2.4,
          2.9,
          2.7,
          2,
          3,
          2.2,
          2.9,
          2.9,
          3.1,
          3,
          2.7,
          2.2,
          2.5,
          3.2,
          2.8,
          2.5,
          2.8,
          2.9,
          3,
          2.8,
          3,
          2.9,
          2.6,
          2.4,
          2.4,
          2.7,
          2.7,
          3,
          3.4,
          3.1,
          2.3,
          3,
          2.5,
          2.6,
          3,
          2.6,
          2.3,
          2.7,
          3,
          2.9,
          2.9,
          2.5,
          2.8
         ],
         "xaxis": "x",
         "xbingroup": "x",
         "y": [
          7,
          6.4,
          6.9,
          5.5,
          6.5,
          5.7,
          6.3,
          4.9,
          6.6,
          5.2,
          5,
          5.9,
          6,
          6.1,
          5.6,
          6.7,
          5.6,
          5.8,
          6.2,
          5.6,
          5.9,
          6.1,
          6.3,
          6.1,
          6.4,
          6.6,
          6.8,
          6.7,
          6,
          5.7,
          5.5,
          5.5,
          5.8,
          6,
          5.4,
          6,
          6.7,
          6.3,
          5.6,
          5.5,
          5.5,
          6.1,
          5.8,
          5,
          5.6,
          5.7,
          5.7,
          6.2,
          5.1,
          5.7
         ],
         "yaxis": "y",
         "ybingroup": "y"
        },
        {
         "alignmentgroup": "True",
         "boxpoints": "all",
         "fillcolor": "rgba(255,255,255,0)",
         "hoveron": "points",
         "hovertemplate": "species=versicolor<br>sepal_width=%{x}<extra></extra>",
         "jitter": 0,
         "legendgroup": "versicolor",
         "line": {
          "color": "rgba(255,255,255,0)"
         },
         "marker": {
          "color": "#EF553B",
          "symbol": "line-ns-open"
         },
         "name": "versicolor",
         "offsetgroup": "versicolor",
         "showlegend": false,
         "type": "box",
         "x": [
          3.2,
          3.2,
          3.1,
          2.3,
          2.8,
          2.8,
          3.3,
          2.4,
          2.9,
          2.7,
          2,
          3,
          2.2,
          2.9,
          2.9,
          3.1,
          3,
          2.7,
          2.2,
          2.5,
          3.2,
          2.8,
          2.5,
          2.8,
          2.9,
          3,
          2.8,
          3,
          2.9,
          2.6,
          2.4,
          2.4,
          2.7,
          2.7,
          3,
          3.4,
          3.1,
          2.3,
          3,
          2.5,
          2.6,
          3,
          2.6,
          2.3,
          2.7,
          3,
          2.9,
          2.9,
          2.5,
          2.8
         ],
         "xaxis": "x3",
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "y",
         "hovertemplate": "species=versicolor<br>sepal_length=%{y}<br>count=%{x}<extra></extra>",
         "legendgroup": "versicolor",
         "marker": {
          "color": "#EF553B"
         },
         "name": "versicolor",
         "offsetgroup": "versicolor",
         "opacity": 0.5,
         "showlegend": false,
         "type": "histogram",
         "xaxis": "x2",
         "y": [
          7,
          6.4,
          6.9,
          5.5,
          6.5,
          5.7,
          6.3,
          4.9,
          6.6,
          5.2,
          5,
          5.9,
          6,
          6.1,
          5.6,
          6.7,
          5.6,
          5.8,
          6.2,
          5.6,
          5.9,
          6.1,
          6.3,
          6.1,
          6.4,
          6.6,
          6.8,
          6.7,
          6,
          5.7,
          5.5,
          5.5,
          5.8,
          6,
          5.4,
          6,
          6.7,
          6.3,
          5.6,
          5.5,
          5.5,
          6.1,
          5.8,
          5,
          5.6,
          5.7,
          5.7,
          6.2,
          5.1,
          5.7
         ],
         "yaxis": "y2"
        },
        {
         "contours": {
          "coloring": "none"
         },
         "hovertemplate": "species=virginica<br>sepal_width=%{x}<br>sepal_length=%{y}<br>count=%{z}<extra></extra>",
         "legendgroup": "virginica",
         "line": {
          "color": "#00cc96"
         },
         "name": "virginica",
         "showlegend": true,
         "type": "histogram2dcontour",
         "x": [
          3.3,
          2.7,
          3,
          2.9,
          3,
          3,
          2.5,
          2.9,
          2.5,
          3.6,
          3.2,
          2.7,
          3,
          2.5,
          2.8,
          3.2,
          3,
          3.8,
          2.6,
          2.2,
          3.2,
          2.8,
          2.8,
          2.7,
          3.3,
          3.2,
          2.8,
          3,
          2.8,
          3,
          2.8,
          3.8,
          2.8,
          2.8,
          2.6,
          3,
          3.4,
          3.1,
          3,
          3.1,
          3.1,
          3.1,
          2.7,
          3.2,
          3.3,
          3,
          2.5,
          3,
          3.4,
          3
         ],
         "xaxis": "x",
         "xbingroup": "x",
         "y": [
          6.3,
          5.8,
          7.1,
          6.3,
          6.5,
          7.6,
          4.9,
          7.3,
          6.7,
          7.2,
          6.5,
          6.4,
          6.8,
          5.7,
          5.8,
          6.4,
          6.5,
          7.7,
          7.7,
          6,
          6.9,
          5.6,
          7.7,
          6.3,
          6.7,
          7.2,
          6.2,
          6.1,
          6.4,
          7.2,
          7.4,
          7.9,
          6.4,
          6.3,
          6.1,
          7.7,
          6.3,
          6.4,
          6,
          6.9,
          6.7,
          6.9,
          5.8,
          6.8,
          6.7,
          6.7,
          6.3,
          6.5,
          6.2,
          5.9
         ],
         "yaxis": "y",
         "ybingroup": "y"
        },
        {
         "alignmentgroup": "True",
         "boxpoints": "all",
         "fillcolor": "rgba(255,255,255,0)",
         "hoveron": "points",
         "hovertemplate": "species=virginica<br>sepal_width=%{x}<extra></extra>",
         "jitter": 0,
         "legendgroup": "virginica",
         "line": {
          "color": "rgba(255,255,255,0)"
         },
         "marker": {
          "color": "#00cc96",
          "symbol": "line-ns-open"
         },
         "name": "virginica",
         "offsetgroup": "virginica",
         "showlegend": false,
         "type": "box",
         "x": [
          3.3,
          2.7,
          3,
          2.9,
          3,
          3,
          2.5,
          2.9,
          2.5,
          3.6,
          3.2,
          2.7,
          3,
          2.5,
          2.8,
          3.2,
          3,
          3.8,
          2.6,
          2.2,
          3.2,
          2.8,
          2.8,
          2.7,
          3.3,
          3.2,
          2.8,
          3,
          2.8,
          3,
          2.8,
          3.8,
          2.8,
          2.8,
          2.6,
          3,
          3.4,
          3.1,
          3,
          3.1,
          3.1,
          3.1,
          2.7,
          3.2,
          3.3,
          3,
          2.5,
          3,
          3.4,
          3
         ],
         "xaxis": "x3",
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "y",
         "hovertemplate": "species=virginica<br>sepal_length=%{y}<br>count=%{x}<extra></extra>",
         "legendgroup": "virginica",
         "marker": {
          "color": "#00cc96"
         },
         "name": "virginica",
         "offsetgroup": "virginica",
         "opacity": 0.5,
         "showlegend": false,
         "type": "histogram",
         "xaxis": "x2",
         "y": [
          6.3,
          5.8,
          7.1,
          6.3,
          6.5,
          7.6,
          4.9,
          7.3,
          6.7,
          7.2,
          6.5,
          6.4,
          6.8,
          5.7,
          5.8,
          6.4,
          6.5,
          7.7,
          7.7,
          6,
          6.9,
          5.6,
          7.7,
          6.3,
          6.7,
          7.2,
          6.2,
          6.1,
          6.4,
          7.2,
          7.4,
          7.9,
          6.4,
          6.3,
          6.1,
          7.7,
          6.3,
          6.4,
          6,
          6.9,
          6.7,
          6.9,
          5.8,
          6.8,
          6.7,
          6.7,
          6.3,
          6.5,
          6.2,
          5.9
         ],
         "yaxis": "y2"
        }
       ],
       "layout": {
        "barmode": "overlay",
        "legend": {
         "title": {
          "text": "species"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          0.7363
         ],
         "title": {
          "text": "sepal_width"
         }
        },
        "xaxis2": {
         "anchor": "y2",
         "domain": [
          0.7413,
          1
         ],
         "matches": "x2",
         "showgrid": true,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "xaxis3": {
         "anchor": "y3",
         "domain": [
          0,
          0.7363
         ],
         "matches": "x",
         "showgrid": true,
         "showticklabels": false
        },
        "xaxis4": {
         "anchor": "y4",
         "domain": [
          0.7413,
          1
         ],
         "matches": "x2",
         "showgrid": true,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          0.7326
         ],
         "title": {
          "text": "sepal_length"
         }
        },
        "yaxis2": {
         "anchor": "x2",
         "domain": [
          0,
          0.7326
         ],
         "matches": "y",
         "showgrid": true,
         "showticklabels": false
        },
        "yaxis3": {
         "anchor": "x3",
         "domain": [
          0.7426,
          1
         ],
         "matches": "y3",
         "showgrid": false,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "yaxis4": {
         "anchor": "x4",
         "domain": [
          0.7426,
          1
         ],
         "matches": "y3",
         "showgrid": true,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.density_contour(iris,\n",
    "                   x=\"sepal_width\",\n",
    "                   y=\"sepal_length\",\n",
    "                   color=\"species\",\n",
    "                   marginal_x=\"rug\",  # 需要传入边缘图形\n",
    "                   marginal_y=\"histogram\"   \n",
    "                  )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 密度热力图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "coloraxis": "coloraxis",
         "hovertemplate": "sepal_width=%{x}<br>sepal_length=%{y}<br>count=%{z}<extra></extra>",
         "name": "",
         "type": "histogram2d",
         "x": [
          3.5,
          3,
          3.2,
          3.1,
          3.6,
          3.9,
          3.4,
          3.4,
          2.9,
          3.1,
          3.7,
          3.4,
          3,
          3,
          4,
          4.4,
          3.9,
          3.5,
          3.8,
          3.8,
          3.4,
          3.7,
          3.6,
          3.3,
          3.4,
          3,
          3.4,
          3.5,
          3.4,
          3.2,
          3.1,
          3.4,
          4.1,
          4.2,
          3.1,
          3.2,
          3.5,
          3.1,
          3,
          3.4,
          3.5,
          2.3,
          3.2,
          3.5,
          3.8,
          3,
          3.8,
          3.2,
          3.7,
          3.3,
          3.2,
          3.2,
          3.1,
          2.3,
          2.8,
          2.8,
          3.3,
          2.4,
          2.9,
          2.7,
          2,
          3,
          2.2,
          2.9,
          2.9,
          3.1,
          3,
          2.7,
          2.2,
          2.5,
          3.2,
          2.8,
          2.5,
          2.8,
          2.9,
          3,
          2.8,
          3,
          2.9,
          2.6,
          2.4,
          2.4,
          2.7,
          2.7,
          3,
          3.4,
          3.1,
          2.3,
          3,
          2.5,
          2.6,
          3,
          2.6,
          2.3,
          2.7,
          3,
          2.9,
          2.9,
          2.5,
          2.8,
          3.3,
          2.7,
          3,
          2.9,
          3,
          3,
          2.5,
          2.9,
          2.5,
          3.6,
          3.2,
          2.7,
          3,
          2.5,
          2.8,
          3.2,
          3,
          3.8,
          2.6,
          2.2,
          3.2,
          2.8,
          2.8,
          2.7,
          3.3,
          3.2,
          2.8,
          3,
          2.8,
          3,
          2.8,
          3.8,
          2.8,
          2.8,
          2.6,
          3,
          3.4,
          3.1,
          3,
          3.1,
          3.1,
          3.1,
          2.7,
          3.2,
          3.3,
          3,
          2.5,
          3,
          3.4,
          3
         ],
         "xaxis": "x",
         "xbingroup": "x",
         "y": [
          5.1,
          4.9,
          4.7,
          4.6,
          5,
          5.4,
          4.6,
          5,
          4.4,
          4.9,
          5.4,
          4.8,
          4.8,
          4.3,
          5.8,
          5.7,
          5.4,
          5.1,
          5.7,
          5.1,
          5.4,
          5.1,
          4.6,
          5.1,
          4.8,
          5,
          5,
          5.2,
          5.2,
          4.7,
          4.8,
          5.4,
          5.2,
          5.5,
          4.9,
          5,
          5.5,
          4.9,
          4.4,
          5.1,
          5,
          4.5,
          4.4,
          5,
          5.1,
          4.8,
          5.1,
          4.6,
          5.3,
          5,
          7,
          6.4,
          6.9,
          5.5,
          6.5,
          5.7,
          6.3,
          4.9,
          6.6,
          5.2,
          5,
          5.9,
          6,
          6.1,
          5.6,
          6.7,
          5.6,
          5.8,
          6.2,
          5.6,
          5.9,
          6.1,
          6.3,
          6.1,
          6.4,
          6.6,
          6.8,
          6.7,
          6,
          5.7,
          5.5,
          5.5,
          5.8,
          6,
          5.4,
          6,
          6.7,
          6.3,
          5.6,
          5.5,
          5.5,
          6.1,
          5.8,
          5,
          5.6,
          5.7,
          5.7,
          6.2,
          5.1,
          5.7,
          6.3,
          5.8,
          7.1,
          6.3,
          6.5,
          7.6,
          4.9,
          7.3,
          6.7,
          7.2,
          6.5,
          6.4,
          6.8,
          5.7,
          5.8,
          6.4,
          6.5,
          7.7,
          7.7,
          6,
          6.9,
          5.6,
          7.7,
          6.3,
          6.7,
          7.2,
          6.2,
          6.1,
          6.4,
          7.2,
          7.4,
          7.9,
          6.4,
          6.3,
          6.1,
          7.7,
          6.3,
          6.4,
          6,
          6.9,
          6.7,
          6.9,
          5.8,
          6.8,
          6.7,
          6.7,
          6.3,
          6.5,
          6.2,
          5.9
         ],
         "yaxis": "y",
         "ybingroup": "y"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "hovertemplate": "sepal_width=%{x}<br>count=%{y}<extra></extra>",
         "legendgroup": "",
         "marker": {
          "color": "#0d0887"
         },
         "name": "",
         "offsetgroup": "",
         "opacity": 0.5,
         "showlegend": false,
         "type": "histogram",
         "x": [
          3.5,
          3,
          3.2,
          3.1,
          3.6,
          3.9,
          3.4,
          3.4,
          2.9,
          3.1,
          3.7,
          3.4,
          3,
          3,
          4,
          4.4,
          3.9,
          3.5,
          3.8,
          3.8,
          3.4,
          3.7,
          3.6,
          3.3,
          3.4,
          3,
          3.4,
          3.5,
          3.4,
          3.2,
          3.1,
          3.4,
          4.1,
          4.2,
          3.1,
          3.2,
          3.5,
          3.1,
          3,
          3.4,
          3.5,
          2.3,
          3.2,
          3.5,
          3.8,
          3,
          3.8,
          3.2,
          3.7,
          3.3,
          3.2,
          3.2,
          3.1,
          2.3,
          2.8,
          2.8,
          3.3,
          2.4,
          2.9,
          2.7,
          2,
          3,
          2.2,
          2.9,
          2.9,
          3.1,
          3,
          2.7,
          2.2,
          2.5,
          3.2,
          2.8,
          2.5,
          2.8,
          2.9,
          3,
          2.8,
          3,
          2.9,
          2.6,
          2.4,
          2.4,
          2.7,
          2.7,
          3,
          3.4,
          3.1,
          2.3,
          3,
          2.5,
          2.6,
          3,
          2.6,
          2.3,
          2.7,
          3,
          2.9,
          2.9,
          2.5,
          2.8,
          3.3,
          2.7,
          3,
          2.9,
          3,
          3,
          2.5,
          2.9,
          2.5,
          3.6,
          3.2,
          2.7,
          3,
          2.5,
          2.8,
          3.2,
          3,
          3.8,
          2.6,
          2.2,
          3.2,
          2.8,
          2.8,
          2.7,
          3.3,
          3.2,
          2.8,
          3,
          2.8,
          3,
          2.8,
          3.8,
          2.8,
          2.8,
          2.6,
          3,
          3.4,
          3.1,
          3,
          3.1,
          3.1,
          3.1,
          2.7,
          3.2,
          3.3,
          3,
          2.5,
          3,
          3.4,
          3
         ],
         "xaxis": "x3",
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "boxpoints": "all",
         "fillcolor": "rgba(255,255,255,0)",
         "hoveron": "points",
         "hovertemplate": "sepal_length=%{y}<extra></extra>",
         "jitter": 0,
         "legendgroup": "",
         "line": {
          "color": "rgba(255,255,255,0)"
         },
         "marker": {
          "color": "#0d0887",
          "symbol": "line-ew-open"
         },
         "name": "",
         "offsetgroup": "",
         "showlegend": false,
         "type": "box",
         "xaxis": "x2",
         "y": [
          5.1,
          4.9,
          4.7,
          4.6,
          5,
          5.4,
          4.6,
          5,
          4.4,
          4.9,
          5.4,
          4.8,
          4.8,
          4.3,
          5.8,
          5.7,
          5.4,
          5.1,
          5.7,
          5.1,
          5.4,
          5.1,
          4.6,
          5.1,
          4.8,
          5,
          5,
          5.2,
          5.2,
          4.7,
          4.8,
          5.4,
          5.2,
          5.5,
          4.9,
          5,
          5.5,
          4.9,
          4.4,
          5.1,
          5,
          4.5,
          4.4,
          5,
          5.1,
          4.8,
          5.1,
          4.6,
          5.3,
          5,
          7,
          6.4,
          6.9,
          5.5,
          6.5,
          5.7,
          6.3,
          4.9,
          6.6,
          5.2,
          5,
          5.9,
          6,
          6.1,
          5.6,
          6.7,
          5.6,
          5.8,
          6.2,
          5.6,
          5.9,
          6.1,
          6.3,
          6.1,
          6.4,
          6.6,
          6.8,
          6.7,
          6,
          5.7,
          5.5,
          5.5,
          5.8,
          6,
          5.4,
          6,
          6.7,
          6.3,
          5.6,
          5.5,
          5.5,
          6.1,
          5.8,
          5,
          5.6,
          5.7,
          5.7,
          6.2,
          5.1,
          5.7,
          6.3,
          5.8,
          7.1,
          6.3,
          6.5,
          7.6,
          4.9,
          7.3,
          6.7,
          7.2,
          6.5,
          6.4,
          6.8,
          5.7,
          5.8,
          6.4,
          6.5,
          7.7,
          7.7,
          6,
          6.9,
          5.6,
          7.7,
          6.3,
          6.7,
          7.2,
          6.2,
          6.1,
          6.4,
          7.2,
          7.4,
          7.9,
          6.4,
          6.3,
          6.1,
          7.7,
          6.3,
          6.4,
          6,
          6.9,
          6.7,
          6.9,
          5.8,
          6.8,
          6.7,
          6.7,
          6.3,
          6.5,
          6.2,
          5.9
         ],
         "yaxis": "y2"
        }
       ],
       "layout": {
        "barmode": "overlay",
        "coloraxis": {
         "colorbar": {
          "title": {
           "text": "count"
          }
         },
         "colorscale": [
          [
           0,
           "#0d0887"
          ],
          [
           0.1111111111111111,
           "#46039f"
          ],
          [
           0.2222222222222222,
           "#7201a8"
          ],
          [
           0.3333333333333333,
           "#9c179e"
          ],
          [
           0.4444444444444444,
           "#bd3786"
          ],
          [
           0.5555555555555556,
           "#d8576b"
          ],
          [
           0.6666666666666666,
           "#ed7953"
          ],
          [
           0.7777777777777778,
           "#fb9f3a"
          ],
          [
           0.8888888888888888,
           "#fdca26"
          ],
          [
           1,
           "#f0f921"
          ]
         ]
        },
        "legend": {
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          0.8358
         ],
         "title": {
          "text": "sepal_width"
         }
        },
        "xaxis2": {
         "anchor": "y2",
         "domain": [
          0.8408,
          1
         ],
         "matches": "x2",
         "showgrid": false,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "xaxis3": {
         "anchor": "y3",
         "domain": [
          0,
          0.8358
         ],
         "matches": "x",
         "showgrid": true,
         "showticklabels": false
        },
        "xaxis4": {
         "anchor": "y4",
         "domain": [
          0.8408,
          1
         ],
         "matches": "x2",
         "showgrid": false,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          0.7326
         ],
         "title": {
          "text": "sepal_length"
         }
        },
        "yaxis2": {
         "anchor": "x2",
         "domain": [
          0,
          0.7326
         ],
         "matches": "y",
         "showgrid": true,
         "showticklabels": false
        },
        "yaxis3": {
         "anchor": "x3",
         "domain": [
          0.7426,
          1
         ],
         "matches": "y3",
         "showgrid": true,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        },
        "yaxis4": {
         "anchor": "x4",
         "domain": [
          0.7426,
          1
         ],
         "matches": "y3",
         "showgrid": true,
         "showline": false,
         "showticklabels": false,
         "ticks": ""
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.density_heatmap(iris,\n",
    "                   x=\"sepal_width\",\n",
    "                   y=\"sepal_length\",\n",
    "                   marginal_y=\"rug\",\n",
    "                   marginal_x=\"histogram\"   # 在密度图的基础上，指定另外两种图形\n",
    "                  )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 直方图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=No<br>time=Lunch<br>day=Thur<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "No",
         "marker": {
          "color": "#636efa",
          "pattern": {
           "shape": ""
          }
         },
         "name": "No",
         "offsetgroup": "No",
         "orientation": "v",
         "showlegend": true,
         "type": "histogram",
         "x": [
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Female",
          "Female",
          "Male",
          "Female",
          "Male",
          "Male",
          "Female",
          "Female",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Female",
          "Female",
          "Female",
          "Female",
          "Female",
          "Female",
          "Female",
          "Female",
          "Female",
          "Male",
          "Male",
          "Female",
          "Female",
          "Female",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male"
         ],
         "xaxis": "x5",
         "y": [
          4,
          3,
          2.71,
          3.4,
          1.83,
          2.03,
          5.17,
          2,
          4,
          5.85,
          3,
          1.5,
          1.8,
          2.92,
          2.31,
          1.68,
          2.5,
          2,
          2.52,
          4.2,
          1.48,
          2,
          2,
          2.18,
          1.5,
          2.83,
          1.5,
          2,
          3.25,
          1.25,
          2,
          2,
          2.75,
          3.5,
          6.7,
          5,
          5,
          2.3,
          1.5,
          1.36,
          1.63,
          1.73,
          2,
          1.44
         ],
         "yaxis": "y5"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=No<br>time=Lunch<br>day=Fri<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "No",
         "marker": {
          "color": "#636efa",
          "pattern": {
           "shape": ""
          }
         },
         "name": "No",
         "offsetgroup": "No",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Female"
         ],
         "xaxis": "x6",
         "y": [
          3
         ],
         "yaxis": "y6"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=No<br>time=Dinner<br>day=Thur<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "No",
         "marker": {
          "color": "#636efa",
          "pattern": {
           "shape": ""
          }
         },
         "name": "No",
         "offsetgroup": "No",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Female"
         ],
         "xaxis": "x",
         "y": [
          3
         ],
         "yaxis": "y"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=No<br>time=Dinner<br>day=Fri<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "No",
         "marker": {
          "color": "#636efa",
          "pattern": {
           "shape": ""
          }
         },
         "name": "No",
         "offsetgroup": "No",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Male",
          "Female",
          "Male"
         ],
         "xaxis": "x2",
         "y": [
          3.5,
          3.25,
          1.5
         ],
         "yaxis": "y2"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=No<br>time=Dinner<br>day=Sat<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "No",
         "marker": {
          "color": "#636efa",
          "pattern": {
           "shape": ""
          }
         },
         "name": "No",
         "offsetgroup": "No",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Male",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Female",
          "Female",
          "Male",
          "Female",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male"
         ],
         "xaxis": "x3",
         "y": [
          3.35,
          4.08,
          2.75,
          2.23,
          7.58,
          3.18,
          2.34,
          2,
          2,
          4.3,
          3,
          1.45,
          2.5,
          3,
          2.45,
          3.27,
          3.6,
          2,
          3.07,
          2.31,
          5,
          2.24,
          1.5,
          6.73,
          2.64,
          3.15,
          2.47,
          2.01,
          1.97,
          3,
          2.2,
          1.25,
          4.08,
          3.76,
          3,
          1,
          9,
          3,
          2.72,
          3.39,
          1.47,
          1.25,
          4.67,
          5.92,
          1.75
         ],
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=No<br>time=Dinner<br>day=Sun<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "No",
         "marker": {
          "color": "#636efa",
          "pattern": {
           "shape": ""
          }
         },
         "name": "No",
         "offsetgroup": "No",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Female",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Female",
          "Male",
          "Female",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male"
         ],
         "xaxis": "x4",
         "y": [
          1.01,
          1.66,
          3.5,
          3.31,
          3.61,
          4.71,
          2,
          3.12,
          1.96,
          3.23,
          1.71,
          5,
          1.57,
          3,
          3.02,
          3.92,
          1.67,
          3.71,
          3.5,
          2.54,
          3.06,
          1.32,
          5.6,
          3,
          5,
          6,
          2.05,
          3,
          2.5,
          2.6,
          5.2,
          1.56,
          4.34,
          3.51,
          4,
          2.55,
          4,
          3.5,
          5.07,
          2.5,
          2,
          2.74,
          2,
          2,
          5.14,
          5,
          3.75,
          2.61,
          2,
          3.5,
          2.5,
          2,
          2,
          3.48,
          2.24,
          4.5,
          5
         ],
         "yaxis": "y4"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=Yes<br>time=Lunch<br>day=Thur<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "Yes",
         "marker": {
          "color": "#EF553B",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Yes",
         "offsetgroup": "Yes",
         "orientation": "v",
         "showlegend": true,
         "type": "histogram",
         "x": [
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Female",
          "Female",
          "Female",
          "Male",
          "Female"
         ],
         "xaxis": "x5",
         "y": [
          3,
          5,
          2,
          4.19,
          2.56,
          2.02,
          4,
          2,
          5,
          2,
          2,
          4,
          2.01,
          2,
          2.5,
          4,
          3.23
         ],
         "yaxis": "y5"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=Yes<br>time=Lunch<br>day=Fri<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "Yes",
         "marker": {
          "color": "#EF553B",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Yes",
         "offsetgroup": "Yes",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Male",
          "Female",
          "Male",
          "Male",
          "Female",
          "Female"
         ],
         "xaxis": "x6",
         "y": [
          2.2,
          3.48,
          1.92,
          1.58,
          2.5,
          2
         ],
         "yaxis": "y6"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=Yes<br>time=Dinner<br>day=Fri<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "Yes",
         "marker": {
          "color": "#EF553B",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Yes",
         "offsetgroup": "Yes",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Female"
         ],
         "xaxis": "x2",
         "y": [
          3,
          1,
          4.3,
          4.73,
          4,
          1.5,
          3,
          2.5,
          3
         ],
         "yaxis": "y2"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=Yes<br>time=Dinner<br>day=Sat<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "Yes",
         "marker": {
          "color": "#EF553B",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Yes",
         "offsetgroup": "Yes",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Female",
          "Female",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Female",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Female",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Female",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male"
         ],
         "xaxis": "x3",
         "y": [
          3,
          1.76,
          3.21,
          2,
          1.98,
          3.76,
          1,
          2.09,
          3.14,
          5,
          3.08,
          2.5,
          3.48,
          1.64,
          4.06,
          4.29,
          4,
          1.61,
          2,
          10,
          3.16,
          3.41,
          3,
          2.03,
          2.23,
          2,
          5.16,
          2.5,
          6.5,
          1.1,
          3,
          1.5,
          1.44,
          3.09,
          2.88,
          2,
          3,
          3,
          1,
          1.17,
          2,
          2
         ],
         "yaxis": "y3"
        },
        {
         "alignmentgroup": "True",
         "bingroup": "x",
         "histfunc": "avg",
         "hovertemplate": "smoker=Yes<br>time=Dinner<br>day=Sun<br>sex=%{x}<br>avg of tip=%{y}<extra></extra>",
         "legendgroup": "Yes",
         "marker": {
          "color": "#EF553B",
          "pattern": {
           "shape": ""
          }
         },
         "name": "Yes",
         "offsetgroup": "Yes",
         "orientation": "v",
         "showlegend": false,
         "type": "histogram",
         "x": [
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Male",
          "Female",
          "Male",
          "Female",
          "Male",
          "Male"
         ],
         "xaxis": "x4",
         "y": [
          3,
          5.15,
          3.18,
          4,
          3.11,
          2,
          2,
          4,
          3.55,
          3.68,
          5.65,
          3.5,
          6.5,
          3,
          3.5,
          2,
          3.5,
          4,
          1.5
         ],
         "yaxis": "y4"
        }
       ],
       "layout": {
        "annotations": [
         {
          "font": {},
          "showarrow": false,
          "text": "day=Thur",
          "x": 0.11499999999999999,
          "xanchor": "center",
          "xref": "paper",
          "y": 1,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {},
          "showarrow": false,
          "text": "day=Fri",
          "x": 0.365,
          "xanchor": "center",
          "xref": "paper",
          "y": 1,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {},
          "showarrow": false,
          "text": "day=Sat",
          "x": 0.615,
          "xanchor": "center",
          "xref": "paper",
          "y": 1,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {},
          "showarrow": false,
          "text": "day=Sun",
          "x": 0.865,
          "xanchor": "center",
          "xref": "paper",
          "y": 1,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {},
          "showarrow": false,
          "text": "time=Dinner",
          "textangle": 90,
          "x": 0.98,
          "xanchor": "left",
          "xref": "paper",
          "y": 0.2425,
          "yanchor": "middle",
          "yref": "paper"
         },
         {
          "font": {},
          "showarrow": false,
          "text": "time=Lunch",
          "textangle": 90,
          "x": 0.98,
          "xanchor": "left",
          "xref": "paper",
          "y": 0.7575000000000001,
          "yanchor": "middle",
          "yref": "paper"
         }
        ],
        "barmode": "group",
        "legend": {
         "title": {
          "text": "smoker"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        },
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          0.22999999999999998
         ],
         "title": {
          "text": "sex"
         }
        },
        "xaxis2": {
         "anchor": "y2",
         "domain": [
          0.24999999999999997,
          0.48
         ],
         "matches": "x",
         "title": {
          "text": "sex"
         }
        },
        "xaxis3": {
         "anchor": "y3",
         "domain": [
          0.49999999999999994,
          0.73
         ],
         "matches": "x",
         "title": {
          "text": "sex"
         }
        },
        "xaxis4": {
         "anchor": "y4",
         "domain": [
          0.75,
          0.98
         ],
         "matches": "x",
         "title": {
          "text": "sex"
         }
        },
        "xaxis5": {
         "anchor": "y5",
         "domain": [
          0,
          0.22999999999999998
         ],
         "matches": "x",
         "showticklabels": false
        },
        "xaxis6": {
         "anchor": "y6",
         "domain": [
          0.24999999999999997,
          0.48
         ],
         "matches": "x",
         "showticklabels": false
        },
        "xaxis7": {
         "anchor": "y7",
         "domain": [
          0.49999999999999994,
          0.73
         ],
         "matches": "x",
         "showticklabels": false
        },
        "xaxis8": {
         "anchor": "y8",
         "domain": [
          0.75,
          0.98
         ],
         "matches": "x",
         "showticklabels": false
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          0.485
         ],
         "title": {
          "text": "avg of tip"
         }
        },
        "yaxis2": {
         "anchor": "x2",
         "domain": [
          0,
          0.485
         ],
         "matches": "y",
         "showticklabels": false
        },
        "yaxis3": {
         "anchor": "x3",
         "domain": [
          0,
          0.485
         ],
         "matches": "y",
         "showticklabels": false
        },
        "yaxis4": {
         "anchor": "x4",
         "domain": [
          0,
          0.485
         ],
         "matches": "y",
         "showticklabels": false
        },
        "yaxis5": {
         "anchor": "x5",
         "domain": [
          0.515,
          1
         ],
         "matches": "y",
         "title": {
          "text": "avg of tip"
         }
        },
        "yaxis6": {
         "anchor": "x6",
         "domain": [
          0.515,
          1
         ],
         "matches": "y",
         "showticklabels": false
        },
        "yaxis7": {
         "anchor": "x7",
         "domain": [
          0.515,
          1
         ],
         "matches": "y",
         "showticklabels": false
        },
        "yaxis8": {
         "anchor": "x8",
         "domain": [
          0.515,
          1
         ],
         "matches": "y",
         "showticklabels": false
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.histogram(\n",
    "    tips,  # 绘图数据\n",
    "    x=\"sex\",  # 指定两个数轴\n",
    "    y=\"tip\",\n",
    "    histfunc=\"avg\",  # 直方图函数：均值\n",
    "    color=\"smoker\",  # 颜色取值\n",
    "    barmode=\"group\",  # 柱状图模式\n",
    "    facet_row=\"time\",  # 横纵纵轴的字段设置\n",
    "    facet_col=\"day\",\n",
    "    category_orders={\"day\":[\"Thur\",\"Fri\",\"Sat\",\"Sun\"],  # 分类\n",
    "                     \"time\":[\"Lunch\",\"Dinner\"]})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 矩阵式树状图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "code_folding": []
   },
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "branchvalues": "total",
         "customdata": [
          [
           "AFG",
           25268405
          ],
          [
           "ALB",
           3508512
          ],
          [
           "DZA",
           31287142
          ],
          [
           "AGO",
           10866106
          ],
          [
           "ARG",
           38331121
          ],
          [
           "AUS",
           19546792
          ],
          [
           "AUT",
           8148312
          ],
          [
           "BHR",
           656397
          ],
          [
           "BGD",
           135656790
          ],
          [
           "BEL",
           10311970
          ],
          [
           "BEN",
           7026113
          ],
          [
           "BOL",
           8445134
          ],
          [
           "BIH",
           4165416
          ],
          [
           "BWA",
           1630347
          ],
          [
           "BRA",
           179914212
          ],
          [
           "BGR",
           7661799
          ],
          [
           "BFA",
           12251209
          ],
          [
           "BDI",
           7021078
          ],
          [
           "KHM",
           12926707
          ],
          [
           "CMR",
           15929988
          ],
          [
           "CAN",
           31902268
          ],
          [
           "CAF",
           4048013
          ],
          [
           "TCD",
           8835739
          ],
          [
           "CHL",
           15497046
          ],
          [
           "CHN",
           1280400000
          ],
          [
           "COL",
           41008227
          ],
          [
           "COM",
           614382
          ],
          [
           "COD",
           55379852
          ],
          [
           "COG",
           3328795
          ],
          [
           "CRI",
           3834934
          ],
          [
           "CIV",
           16252726
          ],
          [
           "HRV",
           4481020
          ],
          [
           "CUB",
           11226999
          ],
          [
           "CZE",
           10256295
          ],
          [
           "DNK",
           5374693
          ],
          [
           "DJI",
           447416
          ],
          [
           "DOM",
           8650322
          ],
          [
           "ECU",
           12921234
          ],
          [
           "EGY",
           73312559
          ],
          [
           "SLV",
           6353681
          ],
          [
           "GNQ",
           495627
          ],
          [
           "ERI",
           4414865
          ],
          [
           "ETH",
           67946797
          ],
          [
           "FIN",
           5193039
          ],
          [
           "FRA",
           59925035
          ],
          [
           "GAB",
           1299304
          ],
          [
           "GMB",
           1457766
          ],
          [
           "DEU",
           82350671
          ],
          [
           "GHA",
           20550751
          ],
          [
           "GRC",
           10603863
          ],
          [
           "GTM",
           11178650
          ],
          [
           "GIN",
           8807818
          ],
          [
           "GNB",
           1332459
          ],
          [
           "HTI",
           7607651
          ],
          [
           "HND",
           6677328
          ],
          [
           "HKG",
           6762476
          ],
          [
           "HUN",
           10083313
          ],
          [
           "ISL",
           288030
          ],
          [
           "IND",
           1034172547
          ],
          [
           "IDN",
           211060000
          ],
          [
           "IRN",
           66907826
          ],
          [
           "IRQ",
           24001816
          ],
          [
           "IRL",
           3879155
          ],
          [
           "ISR",
           6029529
          ],
          [
           "ITA",
           57926999
          ],
          [
           "JAM",
           2664659
          ],
          [
           "JPN",
           127065840.99999999
          ],
          [
           "JOR",
           5307470
          ],
          [
           "KEN",
           31386842
          ],
          [
           "KOR",
           22215365
          ],
          [
           "KOR",
           47969150
          ],
          [
           "KWT",
           2111561
          ],
          [
           "LBN",
           3677780
          ],
          [
           "LSO",
           2046772
          ],
          [
           "LBR",
           2814651
          ],
          [
           "LBY",
           5368585
          ],
          [
           "MDG",
           16473477
          ],
          [
           "MWI",
           11824495
          ],
          [
           "MYS",
           22662365
          ],
          [
           "MLI",
           10580176
          ],
          [
           "MRT",
           2828858
          ],
          [
           "MUS",
           1200206
          ],
          [
           "MEX",
           102479926.99999999
          ],
          [
           "MNG",
           2674234
          ],
          [
           "MNE",
           720230
          ],
          [
           "MAR",
           31167783
          ],
          [
           "MOZ",
           18473780
          ],
          [
           "MMR",
           45598081
          ],
          [
           "NAM",
           1972153
          ],
          [
           "NPL",
           25873917
          ],
          [
           "NLD",
           16122830
          ],
          [
           "NZL",
           3908037
          ],
          [
           "NIC",
           5146848
          ],
          [
           "NER",
           11140655
          ],
          [
           "NGA",
           119901274
          ],
          [
           "NOR",
           4535591
          ],
          [
           "OMN",
           2713462
          ],
          [
           "PAK",
           153403524
          ],
          [
           "PAN",
           2990875
          ],
          [
           "PRY",
           5884491
          ],
          [
           "PER",
           26769436
          ],
          [
           "PHL",
           82995088
          ],
          [
           "POL",
           38625976
          ],
          [
           "PRT",
           10433867
          ],
          [
           "PRI",
           3859606
          ],
          [
           "REU",
           743981
          ],
          [
           "ROU",
           22404337
          ],
          [
           "RWA",
           7852401
          ],
          [
           "STP",
           170372
          ],
          [
           "SAU",
           24501530
          ],
          [
           "SEN",
           10870037
          ],
          [
           "SRB",
           10111559
          ],
          [
           "SLE",
           5359092
          ],
          [
           "SGP",
           4197776
          ],
          [
           "SVK",
           5410052
          ],
          [
           "SVN",
           2011497
          ],
          [
           "SOM",
           7753310
          ],
          [
           "ZAF",
           44433622
          ],
          [
           "ESP",
           40152517
          ],
          [
           "LKA",
           19576783
          ],
          [
           "SDN",
           37090298
          ],
          [
           "SWZ",
           1130269
          ],
          [
           "SWE",
           8954175
          ],
          [
           "CHE",
           7361757
          ],
          [
           "SYR",
           17155814
          ],
          [
           "TWN",
           22454239
          ],
          [
           "TZA",
           34593779
          ],
          [
           "THA",
           62806748
          ],
          [
           "TGO",
           4977378
          ],
          [
           "TTO",
           1101832
          ],
          [
           "TUN",
           9770575
          ],
          [
           "TUR",
           67308928
          ],
          [
           "UGA",
           24739869
          ],
          [
           "GBR",
           59912431
          ],
          [
           "USA",
           287675526
          ],
          [
           "URY",
           3363085
          ],
          [
           "VEN",
           24287670
          ],
          [
           "VNM",
           80908147
          ],
          [
           "PSE",
           3389578
          ],
          [
           "YEM",
           18701257
          ],
          [
           "ZMB",
           10595811
          ],
          [
           "ZWE",
           11926563
          ],
          [
           "(?)",
           46461219.277877375
          ],
          [
           "(?)",
           155535770.18232226
          ],
          [
           "(?)",
           789372254.0800054
          ],
          [
           "(?)",
           46323954.329746254
          ],
          [
           "(?)",
           16941067.04784047
          ],
          [
           "(?)",
           516606618.51472026
          ]
         ],
         "domain": {
          "x": [
           0,
           1
          ],
          "y": [
           0,
           1
          ]
         },
         "hovertemplate": "labels=%{label}<br>pop_sum=%{value}<br>parent=%{parent}<br>id=%{id}<br>iso_alpha=%{customdata[0]}<br>pop=%{color}<extra></extra>",
         "ids": [
          "world/Asia/Afghanistan",
          "world/Europe/Albania",
          "world/Africa/Algeria",
          "world/Africa/Angola",
          "world/Americas/Argentina",
          "world/Oceania/Australia",
          "world/Europe/Austria",
          "world/Asia/Bahrain",
          "world/Asia/Bangladesh",
          "world/Europe/Belgium",
          "world/Africa/Benin",
          "world/Americas/Bolivia",
          "world/Europe/Bosnia and Herzegovina",
          "world/Africa/Botswana",
          "world/Americas/Brazil",
          "world/Europe/Bulgaria",
          "world/Africa/Burkina Faso",
          "world/Africa/Burundi",
          "world/Asia/Cambodia",
          "world/Africa/Cameroon",
          "world/Americas/Canada",
          "world/Africa/Central African Republic",
          "world/Africa/Chad",
          "world/Americas/Chile",
          "world/Asia/China",
          "world/Americas/Colombia",
          "world/Africa/Comoros",
          "world/Africa/Congo, Dem. Rep.",
          "world/Africa/Congo, Rep.",
          "world/Americas/Costa Rica",
          "world/Africa/Cote d'Ivoire",
          "world/Europe/Croatia",
          "world/Americas/Cuba",
          "world/Europe/Czech Republic",
          "world/Europe/Denmark",
          "world/Africa/Djibouti",
          "world/Americas/Dominican Republic",
          "world/Americas/Ecuador",
          "world/Africa/Egypt",
          "world/Americas/El Salvador",
          "world/Africa/Equatorial Guinea",
          "world/Africa/Eritrea",
          "world/Africa/Ethiopia",
          "world/Europe/Finland",
          "world/Europe/France",
          "world/Africa/Gabon",
          "world/Africa/Gambia",
          "world/Europe/Germany",
          "world/Africa/Ghana",
          "world/Europe/Greece",
          "world/Americas/Guatemala",
          "world/Africa/Guinea",
          "world/Africa/Guinea-Bissau",
          "world/Americas/Haiti",
          "world/Americas/Honduras",
          "world/Asia/Hong Kong, China",
          "world/Europe/Hungary",
          "world/Europe/Iceland",
          "world/Asia/India",
          "world/Asia/Indonesia",
          "world/Asia/Iran",
          "world/Asia/Iraq",
          "world/Europe/Ireland",
          "world/Asia/Israel",
          "world/Europe/Italy",
          "world/Americas/Jamaica",
          "world/Asia/Japan",
          "world/Asia/Jordan",
          "world/Africa/Kenya",
          "world/Asia/Korea, Dem. Rep.",
          "world/Asia/Korea, Rep.",
          "world/Asia/Kuwait",
          "world/Asia/Lebanon",
          "world/Africa/Lesotho",
          "world/Africa/Liberia",
          "world/Africa/Libya",
          "world/Africa/Madagascar",
          "world/Africa/Malawi",
          "world/Asia/Malaysia",
          "world/Africa/Mali",
          "world/Africa/Mauritania",
          "world/Africa/Mauritius",
          "world/Americas/Mexico",
          "world/Asia/Mongolia",
          "world/Europe/Montenegro",
          "world/Africa/Morocco",
          "world/Africa/Mozambique",
          "world/Asia/Myanmar",
          "world/Africa/Namibia",
          "world/Asia/Nepal",
          "world/Europe/Netherlands",
          "world/Oceania/New Zealand",
          "world/Americas/Nicaragua",
          "world/Africa/Niger",
          "world/Africa/Nigeria",
          "world/Europe/Norway",
          "world/Asia/Oman",
          "world/Asia/Pakistan",
          "world/Americas/Panama",
          "world/Americas/Paraguay",
          "world/Americas/Peru",
          "world/Asia/Philippines",
          "world/Europe/Poland",
          "world/Europe/Portugal",
          "world/Americas/Puerto Rico",
          "world/Africa/Reunion",
          "world/Europe/Romania",
          "world/Africa/Rwanda",
          "world/Africa/Sao Tome and Principe",
          "world/Asia/Saudi Arabia",
          "world/Africa/Senegal",
          "world/Europe/Serbia",
          "world/Africa/Sierra Leone",
          "world/Asia/Singapore",
          "world/Europe/Slovak Republic",
          "world/Europe/Slovenia",
          "world/Africa/Somalia",
          "world/Africa/South Africa",
          "world/Europe/Spain",
          "world/Asia/Sri Lanka",
          "world/Africa/Sudan",
          "world/Africa/Swaziland",
          "world/Europe/Sweden",
          "world/Europe/Switzerland",
          "world/Asia/Syria",
          "world/Asia/Taiwan",
          "world/Africa/Tanzania",
          "world/Asia/Thailand",
          "world/Africa/Togo",
          "world/Americas/Trinidad and Tobago",
          "world/Africa/Tunisia",
          "world/Europe/Turkey",
          "world/Africa/Uganda",
          "world/Europe/United Kingdom",
          "world/Americas/United States",
          "world/Americas/Uruguay",
          "world/Americas/Venezuela",
          "world/Asia/Vietnam",
          "world/Asia/West Bank and Gaza",
          "world/Asia/Yemen, Rep.",
          "world/Africa/Zambia",
          "world/Africa/Zimbabwe",
          "world/Africa",
          "world/Americas",
          "world/Asia",
          "world/Europe",
          "world/Oceania",
          "world"
         ],
         "labels": [
          "Afghanistan",
          "Albania",
          "Algeria",
          "Angola",
          "Argentina",
          "Australia",
          "Austria",
          "Bahrain",
          "Bangladesh",
          "Belgium",
          "Benin",
          "Bolivia",
          "Bosnia and Herzegovina",
          "Botswana",
          "Brazil",
          "Bulgaria",
          "Burkina Faso",
          "Burundi",
          "Cambodia",
          "Cameroon",
          "Canada",
          "Central African Republic",
          "Chad",
          "Chile",
          "China",
          "Colombia",
          "Comoros",
          "Congo, Dem. Rep.",
          "Congo, Rep.",
          "Costa Rica",
          "Cote d'Ivoire",
          "Croatia",
          "Cuba",
          "Czech Republic",
          "Denmark",
          "Djibouti",
          "Dominican Republic",
          "Ecuador",
          "Egypt",
          "El Salvador",
          "Equatorial Guinea",
          "Eritrea",
          "Ethiopia",
          "Finland",
          "France",
          "Gabon",
          "Gambia",
          "Germany",
          "Ghana",
          "Greece",
          "Guatemala",
          "Guinea",
          "Guinea-Bissau",
          "Haiti",
          "Honduras",
          "Hong Kong, China",
          "Hungary",
          "Iceland",
          "India",
          "Indonesia",
          "Iran",
          "Iraq",
          "Ireland",
          "Israel",
          "Italy",
          "Jamaica",
          "Japan",
          "Jordan",
          "Kenya",
          "Korea, Dem. Rep.",
          "Korea, Rep.",
          "Kuwait",
          "Lebanon",
          "Lesotho",
          "Liberia",
          "Libya",
          "Madagascar",
          "Malawi",
          "Malaysia",
          "Mali",
          "Mauritania",
          "Mauritius",
          "Mexico",
          "Mongolia",
          "Montenegro",
          "Morocco",
          "Mozambique",
          "Myanmar",
          "Namibia",
          "Nepal",
          "Netherlands",
          "New Zealand",
          "Nicaragua",
          "Niger",
          "Nigeria",
          "Norway",
          "Oman",
          "Pakistan",
          "Panama",
          "Paraguay",
          "Peru",
          "Philippines",
          "Poland",
          "Portugal",
          "Puerto Rico",
          "Reunion",
          "Romania",
          "Rwanda",
          "Sao Tome and Principe",
          "Saudi Arabia",
          "Senegal",
          "Serbia",
          "Sierra Leone",
          "Singapore",
          "Slovak Republic",
          "Slovenia",
          "Somalia",
          "South Africa",
          "Spain",
          "Sri Lanka",
          "Sudan",
          "Swaziland",
          "Sweden",
          "Switzerland",
          "Syria",
          "Taiwan",
          "Tanzania",
          "Thailand",
          "Togo",
          "Trinidad and Tobago",
          "Tunisia",
          "Turkey",
          "Uganda",
          "United Kingdom",
          "United States",
          "Uruguay",
          "Venezuela",
          "Vietnam",
          "West Bank and Gaza",
          "Yemen, Rep.",
          "Zambia",
          "Zimbabwe",
          "Africa",
          "Americas",
          "Asia",
          "Europe",
          "Oceania",
          "world"
         ],
         "marker": {
          "coloraxis": "coloraxis",
          "colors": [
           25268405,
           3508512,
           31287142,
           10866106,
           38331121,
           19546792,
           8148312,
           656397,
           135656790,
           10311970,
           7026113,
           8445134,
           4165416,
           1630347,
           179914212,
           7661799,
           12251209,
           7021078,
           12926707,
           15929988,
           31902268,
           4048013,
           8835739,
           15497046,
           1280400000,
           41008227,
           614382,
           55379852,
           3328795,
           3834934,
           16252726,
           4481020,
           11226999,
           10256295,
           5374693,
           447416,
           8650322,
           12921234,
           73312559,
           6353681,
           495627,
           4414865,
           67946797,
           5193039,
           59925035,
           1299304,
           1457766,
           82350671,
           20550751,
           10603863,
           11178650,
           8807818,
           1332459,
           7607651,
           6677328,
           6762476,
           10083313,
           288030,
           1034172547,
           211060000,
           66907826,
           24001816,
           3879155,
           6029529,
           57926999,
           2664659,
           127065840.99999999,
           5307470,
           31386842,
           22215365,
           47969150,
           2111561,
           3677780,
           2046772,
           2814651,
           5368585,
           16473477,
           11824495,
           22662365,
           10580176,
           2828858,
           1200206,
           102479926.99999999,
           2674234,
           720230,
           31167783,
           18473780,
           45598081,
           1972153,
           25873917,
           16122830,
           3908037,
           5146848,
           11140655,
           119901274,
           4535591,
           2713462,
           153403524,
           2990875,
           5884491,
           26769436,
           82995088,
           38625976,
           10433867,
           3859606,
           743981,
           22404337,
           7852401,
           170372,
           24501530,
           10870037,
           10111559,
           5359092,
           4197776,
           5410052,
           2011497,
           7753310,
           44433622,
           40152517,
           19576783,
           37090298,
           1130269,
           8954175,
           7361757,
           17155814,
           22454239,
           34593779,
           62806748,
           4977378,
           1101832,
           9770575,
           67308928,
           24739869,
           59912431,
           287675526,
           3363085,
           24287670,
           80908147,
           3389578,
           18701257,
           10595811,
           11926563,
           46461219.277877375,
           155535770.18232226,
           789372254.0800054,
           46323954.329746254,
           16941067.04784047,
           516606618.51472026
          ]
         },
         "name": "",
         "parents": [
          "world/Asia",
          "world/Europe",
          "world/Africa",
          "world/Africa",
          "world/Americas",
          "world/Oceania",
          "world/Europe",
          "world/Asia",
          "world/Asia",
          "world/Europe",
          "world/Africa",
          "world/Americas",
          "world/Europe",
          "world/Africa",
          "world/Americas",
          "world/Europe",
          "world/Africa",
          "world/Africa",
          "world/Asia",
          "world/Africa",
          "world/Americas",
          "world/Africa",
          "world/Africa",
          "world/Americas",
          "world/Asia",
          "world/Americas",
          "world/Africa",
          "world/Africa",
          "world/Africa",
          "world/Americas",
          "world/Africa",
          "world/Europe",
          "world/Americas",
          "world/Europe",
          "world/Europe",
          "world/Africa",
          "world/Americas",
          "world/Americas",
          "world/Africa",
          "world/Americas",
          "world/Africa",
          "world/Africa",
          "world/Africa",
          "world/Europe",
          "world/Europe",
          "world/Africa",
          "world/Africa",
          "world/Europe",
          "world/Africa",
          "world/Europe",
          "world/Americas",
          "world/Africa",
          "world/Africa",
          "world/Americas",
          "world/Americas",
          "world/Asia",
          "world/Europe",
          "world/Europe",
          "world/Asia",
          "world/Asia",
          "world/Asia",
          "world/Asia",
          "world/Europe",
          "world/Asia",
          "world/Europe",
          "world/Americas",
          "world/Asia",
          "world/Asia",
          "world/Africa",
          "world/Asia",
          "world/Asia",
          "world/Asia",
          "world/Asia",
          "world/Africa",
          "world/Africa",
          "world/Africa",
          "world/Africa",
          "world/Africa",
          "world/Asia",
          "world/Africa",
          "world/Africa",
          "world/Africa",
          "world/Americas",
          "world/Asia",
          "world/Europe",
          "world/Africa",
          "world/Africa",
          "world/Asia",
          "world/Africa",
          "world/Asia",
          "world/Europe",
          "world/Oceania",
          "world/Americas",
          "world/Africa",
          "world/Africa",
          "world/Europe",
          "world/Asia",
          "world/Asia",
          "world/Americas",
          "world/Americas",
          "world/Americas",
          "world/Asia",
          "world/Europe",
          "world/Europe",
          "world/Americas",
          "world/Africa",
          "world/Europe",
          "world/Africa",
          "world/Africa",
          "world/Asia",
          "world/Africa",
          "world/Europe",
          "world/Africa",
          "world/Asia",
          "world/Europe",
          "world/Europe",
          "world/Africa",
          "world/Africa",
          "world/Europe",
          "world/Asia",
          "world/Africa",
          "world/Africa",
          "world/Europe",
          "world/Europe",
          "world/Asia",
          "world/Asia",
          "world/Africa",
          "world/Asia",
          "world/Africa",
          "world/Americas",
          "world/Africa",
          "world/Europe",
          "world/Africa",
          "world/Europe",
          "world/Americas",
          "world/Americas",
          "world/Americas",
          "world/Asia",
          "world/Asia",
          "world/Asia",
          "world/Africa",
          "world/Africa",
          "world",
          "world",
          "world",
          "world",
          "world",
          ""
         ],
         "type": "treemap",
         "values": [
          25268405,
          3508512,
          31287142,
          10866106,
          38331121,
          19546792,
          8148312,
          656397,
          135656790,
          10311970,
          7026113,
          8445134,
          4165416,
          1630347,
          179914212,
          7661799,
          12251209,
          7021078,
          12926707,
          15929988,
          31902268,
          4048013,
          8835739,
          15497046,
          1280400000,
          41008227,
          614382,
          55379852,
          3328795,
          3834934,
          16252726,
          4481020,
          11226999,
          10256295,
          5374693,
          447416,
          8650322,
          12921234,
          73312559,
          6353681,
          495627,
          4414865,
          67946797,
          5193039,
          59925035,
          1299304,
          1457766,
          82350671,
          20550751,
          10603863,
          11178650,
          8807818,
          1332459,
          7607651,
          6677328,
          6762476,
          10083313,
          288030,
          1034172547,
          211060000,
          66907826,
          24001816,
          3879155,
          6029529,
          57926999,
          2664659,
          127065841,
          5307470,
          31386842,
          22215365,
          47969150,
          2111561,
          3677780,
          2046772,
          2814651,
          5368585,
          16473477,
          11824495,
          22662365,
          10580176,
          2828858,
          1200206,
          102479927,
          2674234,
          720230,
          31167783,
          18473780,
          45598081,
          1972153,
          25873917,
          16122830,
          3908037,
          5146848,
          11140655,
          119901274,
          4535591,
          2713462,
          153403524,
          2990875,
          5884491,
          26769436,
          82995088,
          38625976,
          10433867,
          3859606,
          743981,
          22404337,
          7852401,
          170372,
          24501530,
          10870037,
          10111559,
          5359092,
          4197776,
          5410052,
          2011497,
          7753310,
          44433622,
          40152517,
          19576783,
          37090298,
          1130269,
          8954175,
          7361757,
          17155814,
          22454239,
          34593779,
          62806748,
          4977378,
          1101832,
          9770575,
          67308928,
          24739869,
          59912431,
          287675526,
          3363085,
          24287670,
          80908147,
          3389578,
          18701257,
          10595811,
          11926563,
          833723916,
          849772762,
          3601802203,
          578223869,
          23454829,
          5886977579
         ]
        }
       ],
       "layout": {
        "coloraxis": {
         "colorbar": {
          "title": {
           "text": "pop"
          }
         },
         "colorscale": [
          [
           0,
           "#0d0887"
          ],
          [
           0.1111111111111111,
           "#46039f"
          ],
          [
           0.2222222222222222,
           "#7201a8"
          ],
          [
           0.3333333333333333,
           "#9c179e"
          ],
          [
           0.4444444444444444,
           "#bd3786"
          ],
          [
           0.5555555555555556,
           "#d8576b"
          ],
          [
           0.6666666666666666,
           "#ed7953"
          ],
          [
           0.7777777777777778,
           "#fb9f3a"
          ],
          [
           0.8888888888888888,
           "#fdca26"
          ],
          [
           1,
           "#f0f921"
          ]
         ]
        },
        "legend": {
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 选取2002年数据\n",
    "gapminder_2002 = gapminder[gapminder[\"year\"] == 2002]\n",
    "\n",
    "px.treemap(\n",
    "    gapminder_2002, # 数据\n",
    "    path=[px.Constant('world'), 'continent', 'country'],   # 绘图路径：world---continent---country\n",
    "    values='pop',  # 数据取值\n",
    "    color='pop',   # 颜色取值\n",
    "    hover_data=['iso_alpha'])  # 显示数据：国家简称"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 散点极坐标"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>direction</th>\n",
       "      <th>strength</th>\n",
       "      <th>frequency</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>N</td>\n",
       "      <td>0-1</td>\n",
       "      <td>0.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NNE</td>\n",
       "      <td>0-1</td>\n",
       "      <td>0.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NE</td>\n",
       "      <td>0-1</td>\n",
       "      <td>0.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>ENE</td>\n",
       "      <td>0-1</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>E</td>\n",
       "      <td>0-1</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  direction strength  frequency\n",
       "0         N      0-1        0.5\n",
       "1       NNE      0-1        0.6\n",
       "2        NE      0-1        0.5\n",
       "3       ENE      0-1        0.4\n",
       "4         E      0-1        0.4"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "wind = px.data.wind()\n",
    "wind.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "strength=0-1<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "0-1",
         "marker": {
          "color": "#f0f921",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "0-1",
         "r": [
          0.5,
          0.6,
          0.5,
          0.4,
          0.4,
          0.3,
          0.4,
          0.4,
          0.6,
          0.4,
          0.5,
          0.6,
          0.6,
          0.5,
          0.4,
          0.1
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "scatterpolar"
        },
        {
         "hovertemplate": "strength=1-2<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "1-2",
         "marker": {
          "color": "#fdca26",
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "1-2",
         "r": [
          1.6,
          1.8,
          1.5,
          1.6,
          1.6,
          1.2,
          1.5,
          1.7,
          2.2,
          2,
          2.3,
          2.4,
          2.3,
          2.6,
          2.3,
          0.8
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "scatterpolar"
        },
        {
         "hovertemplate": "strength=2-3<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "2-3",
         "marker": {
          "color": "#fb9f3a",
          "symbol": "square"
         },
         "mode": "markers",
         "name": "2-3",
         "r": [
          0.9,
          1.3,
          1.6,
          0.9,
          1,
          0.6,
          0.6,
          0.9,
          1.4,
          1.7,
          1.9,
          2.2,
          1.8,
          1.7,
          1.8,
          0.8
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "scatterpolar"
        },
        {
         "hovertemplate": "strength=3-4<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "3-4",
         "marker": {
          "color": "#ed7953",
          "symbol": "x"
         },
         "mode": "markers",
         "name": "3-4",
         "r": [
          0.9,
          0.8,
          1.2,
          1,
          0.8,
          0.4,
          0.5,
          0.5,
          0.8,
          0.9,
          1.3,
          1.1,
          1.2,
          1.2,
          1.3,
          1
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "scatterpolar"
        },
        {
         "hovertemplate": "strength=4-4<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "4-4",
         "marker": {
          "color": "#d8576b",
          "symbol": "cross"
         },
         "mode": "markers",
         "name": "4-4",
         "r": [
          0.4,
          0.5,
          1.2,
          0.5,
          0.4,
          0.2,
          0.4,
          0.4,
          0.7,
          0.6,
          0.7,
          0.8,
          0.9,
          1,
          1,
          0.7
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "scatterpolar"
        },
        {
         "hovertemplate": "strength=4-5<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "4-5",
         "marker": {
          "color": "#bd3786",
          "symbol": "circle"
         },
         "mode": "markers",
         "name": "4-5",
         "r": [
          0.3,
          0.3,
          0.6,
          0.2,
          0.1,
          0.1,
          0.05,
          0.1,
          0.1,
          0.2,
          0.3,
          0.4,
          0.9,
          0.9,
          0.9,
          0.3
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "scatterpolar"
        },
        {
         "hovertemplate": "strength=5-6<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "5-6",
         "marker": {
          "color": "#9c179e",
          "symbol": "diamond"
         },
         "mode": "markers",
         "name": "5-6",
         "r": [
          0.2,
          0.1,
          0.1,
          0.1,
          0.1,
          0.1,
          0.05,
          0.05,
          0.1,
          0.05,
          0.2,
          0.2,
          0.4,
          0.7,
          0.7,
          0.4
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "scatterpolar"
        },
        {
         "hovertemplate": "strength=6+<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "6+",
         "marker": {
          "color": "#7201a8",
          "symbol": "square"
         },
         "mode": "markers",
         "name": "6+",
         "r": [
          0.1,
          0.1,
          0.1,
          0.1,
          0.1,
          0.05,
          0.05,
          0.05,
          0.05,
          0.1,
          0.1,
          0.1,
          0.9,
          2.2,
          1.5,
          0.2
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "scatterpolar"
        }
       ],
       "layout": {
        "legend": {
         "title": {
          "text": "strength"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "polar": {
         "angularaxis": {
          "direction": "clockwise",
          "rotation": 90
         },
         "domain": {
          "x": [
           0,
           1
          ],
          "y": [
           0,
           1
          ]
         }
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "#E5ECF6",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "white",
             "linecolor": "white",
             "minorgridcolor": "white",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "#E5ECF6",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "white"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "#E5ECF6",
          "polar": {
           "angularaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "radialaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "yaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           },
           "zaxis": {
            "backgroundcolor": "#E5ECF6",
            "gridcolor": "white",
            "gridwidth": 2,
            "linecolor": "white",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "white"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           },
           "bgcolor": "#E5ECF6",
           "caxis": {
            "gridcolor": "white",
            "linecolor": "white",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "white",
           "linecolor": "white",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "white",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "px.scatter_polar(\n",
    "    wind,  #  数据集\n",
    "    r=\"frequency\",  # 半径\n",
    "    theta=\"direction\",   # 角度\n",
    "    color=\"strength\",  # 颜色\n",
    "    symbol=\"strength\",  # 符号\n",
    "    color_discrete_sequence=px.colors.sequential.Plasma_r)  # 颜色"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "hovertemplate": "strength=0-1<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "0-1",
         "marker": {
          "color": "#f0f921",
          "pattern": {
           "shape": ""
          }
         },
         "name": "0-1",
         "r": [
          0.5,
          0.6,
          0.5,
          0.4,
          0.4,
          0.3,
          0.4,
          0.4,
          0.6,
          0.4,
          0.5,
          0.6,
          0.6,
          0.5,
          0.4,
          0.1
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "barpolar"
        },
        {
         "hovertemplate": "strength=1-2<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "1-2",
         "marker": {
          "color": "#fdca26",
          "pattern": {
           "shape": ""
          }
         },
         "name": "1-2",
         "r": [
          1.6,
          1.8,
          1.5,
          1.6,
          1.6,
          1.2,
          1.5,
          1.7,
          2.2,
          2,
          2.3,
          2.4,
          2.3,
          2.6,
          2.3,
          0.8
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "barpolar"
        },
        {
         "hovertemplate": "strength=2-3<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "2-3",
         "marker": {
          "color": "#fb9f3a",
          "pattern": {
           "shape": ""
          }
         },
         "name": "2-3",
         "r": [
          0.9,
          1.3,
          1.6,
          0.9,
          1,
          0.6,
          0.6,
          0.9,
          1.4,
          1.7,
          1.9,
          2.2,
          1.8,
          1.7,
          1.8,
          0.8
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "barpolar"
        },
        {
         "hovertemplate": "strength=3-4<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "3-4",
         "marker": {
          "color": "#ed7953",
          "pattern": {
           "shape": ""
          }
         },
         "name": "3-4",
         "r": [
          0.9,
          0.8,
          1.2,
          1,
          0.8,
          0.4,
          0.5,
          0.5,
          0.8,
          0.9,
          1.3,
          1.1,
          1.2,
          1.2,
          1.3,
          1
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "barpolar"
        },
        {
         "hovertemplate": "strength=4-4<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "4-4",
         "marker": {
          "color": "#d8576b",
          "pattern": {
           "shape": ""
          }
         },
         "name": "4-4",
         "r": [
          0.4,
          0.5,
          1.2,
          0.5,
          0.4,
          0.2,
          0.4,
          0.4,
          0.7,
          0.6,
          0.7,
          0.8,
          0.9,
          1,
          1,
          0.7
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "barpolar"
        },
        {
         "hovertemplate": "strength=4-5<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "4-5",
         "marker": {
          "color": "#bd3786",
          "pattern": {
           "shape": ""
          }
         },
         "name": "4-5",
         "r": [
          0.3,
          0.3,
          0.6,
          0.2,
          0.1,
          0.1,
          0.05,
          0.1,
          0.1,
          0.2,
          0.3,
          0.4,
          0.9,
          0.9,
          0.9,
          0.3
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "barpolar"
        },
        {
         "hovertemplate": "strength=5-6<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "5-6",
         "marker": {
          "color": "#9c179e",
          "pattern": {
           "shape": ""
          }
         },
         "name": "5-6",
         "r": [
          0.2,
          0.1,
          0.1,
          0.1,
          0.1,
          0.1,
          0.05,
          0.05,
          0.1,
          0.05,
          0.2,
          0.2,
          0.4,
          0.7,
          0.7,
          0.4
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "barpolar"
        },
        {
         "hovertemplate": "strength=6+<br>frequency=%{r}<br>direction=%{theta}<extra></extra>",
         "legendgroup": "6+",
         "marker": {
          "color": "#7201a8",
          "pattern": {
           "shape": ""
          }
         },
         "name": "6+",
         "r": [
          0.1,
          0.1,
          0.1,
          0.1,
          0.1,
          0.05,
          0.05,
          0.05,
          0.05,
          0.1,
          0.1,
          0.1,
          0.9,
          2.2,
          1.5,
          0.2
         ],
         "showlegend": true,
         "subplot": "polar",
         "theta": [
          "N",
          "NNE",
          "NE",
          "ENE",
          "E",
          "ESE",
          "SE",
          "SSE",
          "S",
          "SSW",
          "SW",
          "WSW",
          "W",
          "WNW",
          "NW",
          "NNW"
         ],
         "type": "barpolar"
        }
       ],
       "layout": {
        "barmode": "relative",
        "legend": {
         "title": {
          "text": "strength"
         },
         "tracegroupgap": 0
        },
        "margin": {
         "t": 60
        },
        "polar": {
         "angularaxis": {
          "direction": "clockwise",
          "rotation": 90
         },
         "domain": {
          "x": [
           0,
           1
          ],
          "y": [
           0,
           1
          ]
         }
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#f2f5fa"
            },
            "error_y": {
             "color": "#f2f5fa"
            },
            "marker": {
             "line": {
              "color": "rgb(17,17,17)",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "rgb(17,17,17)",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#A2B1C6",
             "gridcolor": "#506784",
             "linecolor": "#506784",
             "minorgridcolor": "#506784",
             "startlinecolor": "#A2B1C6"
            },
            "baxis": {
             "endlinecolor": "#A2B1C6",
             "gridcolor": "#506784",
             "linecolor": "#506784",
             "minorgridcolor": "#506784",
             "startlinecolor": "#A2B1C6"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "marker": {
             "line": {
              "color": "#283442"
             }
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "line": {
              "color": "#283442"
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#506784"
             },
             "line": {
              "color": "rgb(17,17,17)"
             }
            },
            "header": {
             "fill": {
              "color": "#2a3f5f"
             },
             "line": {
              "color": "rgb(17,17,17)"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#f2f5fa",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#f2f5fa"
          },
          "geo": {
           "bgcolor": "rgb(17,17,17)",
           "lakecolor": "rgb(17,17,17)",
           "landcolor": "rgb(17,17,17)",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#506784"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "dark"
          },
          "paper_bgcolor": "rgb(17,17,17)",
          "plot_bgcolor": "rgb(17,17,17)",
          "polar": {
           "angularaxis": {
            "gridcolor": "#506784",
            "linecolor": "#506784",
            "ticks": ""
           },
           "bgcolor": "rgb(17,17,17)",
           "radialaxis": {
            "gridcolor": "#506784",
            "linecolor": "#506784",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "rgb(17,17,17)",
            "gridcolor": "#506784",
            "gridwidth": 2,
            "linecolor": "#506784",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#C8D4E3"
           },
           "yaxis": {
            "backgroundcolor": "rgb(17,17,17)",
            "gridcolor": "#506784",
            "gridwidth": 2,
            "linecolor": "#506784",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#C8D4E3"
           },
           "zaxis": {
            "backgroundcolor": "rgb(17,17,17)",
            "gridcolor": "#506784",
            "gridwidth": 2,
            "linecolor": "#506784",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#C8D4E3"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#f2f5fa"
           }
          },
          "sliderdefaults": {
           "bgcolor": "#C8D4E3",
           "bordercolor": "rgb(17,17,17)",
           "borderwidth": 1,
           "tickwidth": 0
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#506784",
            "linecolor": "#506784",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#506784",
            "linecolor": "#506784",
            "ticks": ""
           },
           "bgcolor": "rgb(17,17,17)",
           "caxis": {
            "gridcolor": "#506784",
            "linecolor": "#506784",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "updatemenudefaults": {
           "bgcolor": "#506784",
           "borderwidth": 0
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#283442",
           "linecolor": "#506784",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#283442",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#283442",
           "linecolor": "#506784",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#283442",
           "zerolinewidth": 2
          }
         }
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = px.bar_polar(\n",
    "    wind,   # 数据集\n",
    "    r=\"frequency\",   # 半径\n",
    "    theta=\"direction\",  # 角度\n",
    "    color=\"strength\",  # 颜色\n",
    "    template=\"plotly_dark\",  # 主题\n",
    "    color_discrete_sequence=px.colors.sequential.Plasma_r)  # 颜色\n",
    "fig.show()"
   ]
  }
 ],
 "metadata": {
  "hide_input": false,
  "kernelspec": {
   "display_name": "Python 3.8.10 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "latex_envs": {
   "LaTeX_envs_menu_present": true,
   "autoclose": false,
   "autocomplete": true,
   "bibliofile": "biblio.bib",
   "cite_by": "apalike",
   "current_citInitial": 1,
   "eqLabelWithNumbers": true,
   "eqNumInitial": 1,
   "hotkeys": {
    "equation": "Ctrl-E",
    "itemize": "Ctrl-I"
   },
   "labels_anchors": false,
   "latex_user_defs": false,
   "report_style_numbering": false,
   "user_envs_cfg": false
  },
  "nbTranslate": {
   "displayLangs": [
    "*"
   ],
   "hotkey": "alt-t",
   "langInMainMenu": true,
   "sourceLang": "en",
   "targetLang": "fr",
   "useGoogleTranslate": true
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  },
  "vscode": {
   "interpreter": {
    "hash": "9650cb4e16cdd4a8e8e2d128bf38d875813998db22a3c986335f89e0cb4d7bb2"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
